Commit Graph

15290 Commits

Author SHA1 Message Date
Quentin Young
09d99a114d
Merge pull request #3798 from robgil/docker-debian9
Quick and dirty debian9 docker image
2019-02-15 13:10:49 -05:00
Quentin Young
4ceb90ec11 README.md: update list of supported protos
WHOoOoOooOoOooOOOOOo!!!

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-15 17:57:13 +00:00
Quentin Young
fd6611bb4b bgpd: fix automake fart under MSAN
"When building without VNC, automake sees that the `bgpd_bgpd_CFLAGS`
variable exists, although it is only set in the VNC-enabled case... but
since the variable exists, it unconditionally drops `AM_CFLAGS` for the
two bgp targets and uses `bgpd_bgpd_CFLAGS` instead, which will
contain... _nothing_."

This was breaking builds of bgpd binaries with MSAN enabled.

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-15 17:41:55 +00:00
Philippe Guibert
18f286adfb ospf6d: reset the global ospf6 pointer
reset the global ospf6 pointer.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-02-15 17:42:13 +01:00
Quentin Young
72de5f4b5d lib: fix garbage array size in zprivs_init
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-15 16:27:55 +00:00
Rob Gil
39e3b9493e
docker: quick and dirty debian 9 img
Signed-off-by: Rob Gil <rob@rem5.com>
2019-02-15 07:42:23 -05:00
Renato Westphal
7dce96f0e4 lib, pbrd: fix indentation of a few commands
When displaying the running configuration, we should use a single
space to indent commands when necessary (and not two spaces).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 22:57:39 -02:00
Renato Westphal
9c0fd85360 pbrd: change the "set nexthop" command to accept interface nexthops
In addition to nexthop groups, pbrd also supports the "set nexthop"
command to specify the nexthop of a PBR map. This adds convenience
when multiple nexthops aren't necessary.

Change this command to support interface nexthops (without IP
addresses) like nexthop groups do. At the end of the command, call
pbr_nht_nexthop_interface_update() otherwise the interface nexthop
won't be validated until we receive an interface up/down notification
from zebra through the zapi protocol.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 22:57:39 -02:00
Renato Westphal
a106a4087b pbrd: add support for interface nexthops
Now that nexthop groups can contain interface nexthops, make the
necessary adjustments in pbrd to handle them appropriately.

For normal IP nexthops, pbrd uses the NHT callbacks to validate
these nexthops (i.e. check if they are reachable). NHT can't be
used for interface nexthops though. To work around this issue,
use the interface event callbacks from the zclient API to validate
interface nexthops (an interface nexthop is valid only if the
corresponding interface is up and running).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 22:57:39 -02:00
Renato Westphal
268c24ee9e pbrd: fix detection of inconsistent nexthop groups
Commit ff9799c31 broke the detection of nexthop groups that contain
both v4 and v6 nexthops. Move the switch statement back to the
ALL_NEXTHOPS loop to fix this issue.

Further, make pbr_nht_which_afi() return AFI_MAX only if all
nexthops from the group are either NEXTHOP_TYPE_IFINDEX or
NEXTHOP_TYPE_BLACKHOLE.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 22:57:39 -02:00
Renato Westphal
aafac994dc pbrd: rename nh_afi variables to nh_type to better convey their meaning
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 22:57:39 -02:00
Renato Westphal
1c869b6418 lib: add support for interface nexthops on nexthop groups
This patch adds support to nexthops of type NEXTHOP_TYPE_IFINDEX to
nexthop-groups. This should be especially useful when dealing with
p2p interfaces like tunnels that don't have IP addresses assigned
to them.

NOTE: nh->addr can be NULL now, so we should always perform a null
check before dereferencing this pointer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 22:57:39 -02:00
Renato Westphal
b43bb64f82 lib: change how nexthop groups store nexthop addresses
Use a pointer to a sockunion instead of a full sockunion in the
nexthop_hold structure. This prepares the ground for the next commit,
which will make nexthop addresses optional (in this commit we assume
nh->addr will never be NULL, but this will change).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 20:01:30 -02:00
Renato Westphal
e5a501c2ed lib: consolidate nexthop-group deletion in a single place
Reuse the nhgl_delete() function to avoid code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-14 20:00:14 -02:00
Quentin Young
1c77d034e5 lib: fix uninitialized value use in privs.c
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-14 19:01:33 +00:00
Philippe Guibert
22b982dfe9 ospf6d: upon interface deletion, the area if list may be updated
there are some events where the list of interfaces per area should be
reviewed due to an interface is being removed. This fix avoids having
some memory leak.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-02-14 18:24:01 +01:00
Philippe Guibert
d51884e6e1 ospf6d: closing server socket when leaving ospf6d
this commit brings consistency as it closes the socket used to carry
ospfv3 messages.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-02-14 18:24:01 +01:00
Rafael Zalamena
9f37770f59 bfdd: fix CI warnings
Fix a few checkpatch warnings and a clang analyzer warning of
uninitialized variable.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:18:23 -02:00
Rafael Zalamena
e945606e1e bfdd: fix discriminator mismatch log message
The discriminator is an unsigned 32bit variable.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:18:23 -02:00
Rafael Zalamena
0c1af3e49f bfdd: apply new timers on on-going connections
Apply new timers when only one side is negotiating new settings: when
sending the final bit we must apply the remote settings, otherwise
we'll keep the previous transmission rate.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:18:23 -02:00
Rafael Zalamena
33400b469e bfdd: header clean up
Remove some unused definitions in the bfd daemon header.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:18:23 -02:00
Rafael Zalamena
46c8ef96a3 bfdd: don't allow VRF for single hop session
Single hop sessions already allow you to select the interface, which
should be enough to determine the VRF we are running in.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:18:23 -02:00
Rafael Zalamena
d245e522f0 bfdd: implement session interface observer
Allow `bfdd` to configure inexisting interfaces / VRF and only activate
them once the interface/VRF start existing. This implementation doesn't
handle dynamic VRFs yet.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:18:23 -02:00
Rafael Zalamena
843b324ddd bfdd: generate random session identificators
This also avoids returning `session_id == 0` which should not happen.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
6f4beb7b30 bfdd: remove unused vrf/interface data structures
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
b333abc295 bfdd: refactor session lookup
Use internal data to lookup sessions. This approach has two main
advantages:

  * it uses less memory because it doesn't use strings for interface /
    vrf, it uses OS indexes instead;
  * prepares code to support VRF;

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
b912b189c7 bfdd: slow down on peer connection loss
Lets be more RFC 5880 compliant and slow down control packets on
connection loss.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
ff91bf7fb2 bfdd: don't try to start echo on protocol restart
`echo-mode` should and will automatically start after session goes up
and it is allowed by the remote peer. See `bs_echo_timer_handler` for
more information.

This avoids having echo controling code spread.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
1f2d5f91ee bfdd: change slow time value
Let's use the RFC 5880 suggested value of 1 second for slow
transmission speed.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
f43b93686f bfdd: simplify timer data structure
Remove some legacy left overs of the old timer data structure bits and
use a simpler version:

  We always keep the current configuration in the timer structure, but
  also keep the running timers (before poll transition) in
  `cur_timers`.

  With this we can remove `new_timers` and avoid timer copy
  configuration copy on final handler (this also simplifies peer
  show command).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
f78dd3a793 bfdd: don't poll to make echo/multiplier changes
RFC 5880 says that it is only necessary to run polling in two cases:

  - Desired minimum transmission interval;
  - Required minimum receive interval;

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
73c62f8eb3 bfdd: deduplicate echo handling code
Use the standardized echo timer handling function.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
0592db9630 bfdd: fix bug on poll sequence
Poll and Final bits can't be set at the same time in a packet.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
8bd859f6d3 bfdd: echo-mode doesn't need poll to start/stop
Remove all polling negotiation when starting/stopping `echo-mode` as it
is not necessary.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
c0ef9a8a50 bfdd: refactor timer handling
Move timer calculation code outside of the packet handling function
and explain how timers are calculated.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
aef131afc5 bfdd: refactor state change handler
Expand state change handling into smaller functions with more
explanatory commentaries. This also handles some corner cases that
were not being handled.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-02-14 14:17:29 -02:00
Rafael Zalamena
09720d3189
Merge pull request #3799 from donaldsharp/show_debugging
Show debugging for bfd
2019-02-14 14:16:38 -02:00
Mark Stapp
1d0c39fbd8
Merge pull request #3791 from sworleys/RT-Braces-rtadv
zebra: Fix CLANG suggestion for braces on init of struct
2019-02-14 09:07:47 -05:00
Philippe Guibert
c8b9f5fb12 ospf6d: unitialised buffer zone used by socket
a buffer zone is initialised, before being used by server socket.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-02-14 14:17:33 +01:00
Donald Sharp
a244e59954 bfdd: Add show debugging [bfd] command
This will prevent vtysh from displaying `command imcomplete`
for a `show debugging` issued and we are running this
bfd daemon.  A quick look showed me that there was not
really the ability to turn on/off debugging like other
daemons.  I imagine future work can be focused here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13 23:24:05 -05:00
Donald Sharp
6038fe4584 bfdd: Add some code so we can compile from w/ in the bfdd dir
Copy pattern of Makefile from other daemons to allow us to
compile this thingie(tm) from within the bfdd directory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13 23:23:48 -05:00
Mark Stapp
77a4dd9320
Merge pull request #3794 from donaldsharp/sharp_import_check
Sharp import check
2019-02-13 15:25:02 -05:00
Mark Stapp
c919c6b6ef
Merge pull request #3796 from donaldsharp/mpls_deletion_cleanup
zebra: Deletion of a lsp is not a failure event
2019-02-13 15:19:39 -05:00
Donald Sharp
48878e16cb build: non-recursive sharpd
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13 15:03:30 -05:00
Donald Sharp
3fd385c685 zebra: Deletion of a lsp is not a failure event
FRR is reporting that a lsp deletion event as a failure
in the log messsages.  This will lead to confusion and
lots of fun debugging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13 12:49:59 -05:00
Donald Sharp
cfef27e56e
Merge pull request #3622 from mjstapp/fix_cpp_compile
libs, daemons: changes to permit c++ compilation
2019-02-13 12:47:23 -05:00
Donald Sharp
01490ba25d
Merge pull request #3753 from LabNConsulting/working/master/topotest-l3mdev=1
topotest: bgp_l3vpn_to_bgp_vrf: fix setting of TCP l3mdev
2019-02-13 09:32:43 -05:00
Donald Sharp
80d5ff338d sharpd: Add ability to track import-check nexthops
Add the ability to sharp to track import-check type routes
from the cli.  Update docs too.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13 09:28:38 -05:00
Donald Sharp
b47dc61ade sharpd: Allow the registration of import checks to zebra
Minor code modification to allow the sharp_zebra.c code
to differentiate between import check or nexthop watch
types.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13 09:28:38 -05:00
Donald Sharp
7a197b9269
Merge pull request #3778 from mjstapp/fix_dplane_update
zebra: use update semantics for routes consistently
2019-02-12 19:36:02 -05:00