Quentin Young [Mon, 11 Feb 2019 16:36:09 +0000 (16:36 +0000)]
vrrpd: allow creation of adverts with no addresses
Fuzz testing revealed a crash in which VRRPD tries to create an
advertisement packet with no IP addresses. Should never occur under
normal use but might as well patch.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Fri, 8 Feb 2019 19:47:55 +0000 (19:47 +0000)]
vrrpd: properly find iface in manual cfg mode
As a crutch, interface search when manually configuring VRRP on an
interface did a prefix match on the name of macvlan interfaces,
comparing its name to the name of the interface VRRP was configured on
in order to determine if the interface under question was a subinterface
of the configured interface. This is obviously fragile and prone to
failure. We now pass up parent interface info from Zebra so use that
instead to correctly deduce parent-child relationships.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Fri, 1 Feb 2019 18:49:16 +0000 (18:49 +0000)]
vrrpd: cleanup vrrp packet crafting code
* Prefix all packet functions with 'vrrp_pkt'
* Break out checksum computation into separate function
* Accept version field when building advertisements
* Update doc comments
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Do nothing if user tries to add the same IP twice
* Implement deletion of IPs
* Deactivate virtual router if all IPs are deleted
* Deduplicate add / remove code
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Fri, 25 Jan 2019 18:48:41 +0000 (18:48 +0000)]
vrrpd: allow searching for interfaces late
Break out code for assigning macvlan interface to a vrrp router into its
own function so it can be called multiple times. This allows bringing up
IPv4 and IPv6 at different times if all the interfaces are not created
yet.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Wed, 16 Jan 2019 23:14:40 +0000 (23:14 +0000)]
vrrpd: fix ownership discovery and mcast OIF
* Look for virtual IP ownership on the parent of the macvlan, not the
macvlan itself
* IPv4: bind socket to real IP of the macvlan parent, but transmit on
the macvlan interface
* IPv6: bind socket to IPv6 link local of the macvlan interface
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Mon, 7 Jan 2019 19:02:53 +0000 (19:02 +0000)]
vrrpd: add initial macvlan support
* Search for macvlan interfaces with the appropriate name and MAC
address when starting up a new VRRP instance
* Split VRRP socket into two; one for Tx, one for Rx
* Bind Tx socket to the macvlan subinterface so our VRRP advertisements
go out with the correct MAC address
* Send ARP requests from this macvlan subinterface
* Improve error messaging
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Wed, 19 Dec 2018 16:48:36 +0000 (16:48 +0000)]
vrrpd: read and validate vrrp advertisements
* Validate IPvX headers and packet contents
* Remove filter of non-255 TTL IPv4 packets; better to receive, log and
drop them ourselves
* Set outgoing packet TTL / hop limit to 255
* Use existing sockopt functions
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Thu, 6 Dec 2018 21:31:05 +0000 (21:31 +0000)]
vrrpd: clean up configuration code, fix skew bug
* Update vrrp.[ch] file header to be more accurate
* Make vrrp_update_times() private again
* Add times reset function and use it
* Add priority and advertisement interval setter functions and use them
* Add command to change advertisement interval
* Allow showing all VRRP instances
* Improve doc comments on functions
* Add ability to shutdown router
* Reorganize vrrp.h
* Add doc comments to vrrp.h
* Fix bug where Skew_time was not used to compute Master_Down_Interval
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Issue 1:
Getting an empty json without any warning message, while executing
the command "show ip bgp neighbor <x.x.x.x> advertised-routes
json" when the bgp instance is not present or getting created.
Issue 2:
Getting an empty json without any warning message, while executing
the command "show ip bgp vrf/view <name> advertised-routes json"
when the specified view/vrf is not present.
Fix:
Display warning message while executing the above cli commands, when
the bgp instance, specified vrf is not present.
Philippe Guibert [Tue, 14 May 2019 14:39:20 +0000 (16:39 +0200)]
bgpd: do not unregister bfd session when bgp session goes down
This commit fixes a previous commit:
"bfdd: remove operational bfd sessions from remote daemons"
where the handling of unregister call triggers the deletion of bfd
session.
Actually, the BFD session should not be deleted, while bgp session is
configured with BGP. this permits to receive BFD events up, and permit
quicker reconnecion.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Tue, 16 Apr 2019 10:16:17 +0000 (12:16 +0200)]
bfd-bgp-cbit-topo3: add bfd bgp cbit topotest test
this test simulates the case where r1 keeps staled entries of r2,
because r2 is a 'non stop forwarding' device. For instance, r2 restarts
to be upgraded, then r1 keeps the entries, thus avoiding to flush
entries in the dataplane. Here, BFD is used, and the bgp
check-control-plane-failure command is used to inform BGP that if BFD
goes down, this may be because remote peer is restarting, and this may
be necessary to keep the entries of remote.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Tue, 16 Apr 2019 09:50:47 +0000 (11:50 +0200)]
bgpd: add vty command to enable bfd control-plane-check-failure
new vty command is added:
neighbor XXX bfd check-control-plane-failure
this command will enforce the check of bgp controlplane, when bfd
detects changes in the dataplane.
- at configuration, the cbit will be set if that command is executed
- at flapping time, if the command is configured and remote cbit is set
accordingly, then the bfd event will be ignored.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>