summaryrefslogtreecommitdiffstats
path: root/vrrpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* vrrpd: const vrrp_lookup()Quentin Young2019-12-092-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: make vrrp_[add|del]_ip not insaneQuentin Young2019-12-092-11/+16
| | | | | | | | For some reason I made these functions require you to pass the correct (v4 or v6) router when we could determine it from the type of address passed; fix this Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: generously apply constDavid Lamparter2019-12-024-9/+6
| | | | | | const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
* *: make frr_yang_module_info constDavid Lamparter2019-11-301-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* vrrpd: some more error logging fixesQuentin Young2019-10-301-3/+9
| | | | | | | | - Give the correct log message when refusing to start because the vr is already started - Fix a couple other : whynot; cases missed Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: only count ipv4 addresses on check startGhasem Naddaf2019-10-291-6/+6
| | | | Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
* vrrpd: fix startup error message reportingQuentin Young2019-10-211-9/+11
| | | | | | | | | | | | | Due to some extremely shoddy programming on my part, the error messages for certain errors was pretty much always wrong. We would start with the correct error message, then on the next check, regardless of whether it passed or failed, we would null out the error message, then on the next one set it again (to the wrong message), then null it, and just keep alternating. So errors were sometimes not being reported, sometimes being reported correctly (if the condition parity happened to match the appropriate condition), and sometimes being reported correctly. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: use CS2MS instead of constant 10 everywhereGhasem Naddaf2019-10-182-13/+15
| | | | | | | | Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com> vrrpd: use CS2MS instead of constant 10 everywhere Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
* *: Convert zapi->interface_delete to ifp callbackDonald Sharp2019-09-191-18/+2
| | | | | | | Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert interface_down to interface down callbackDonald Sharp2019-09-191-20/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert from ->interface_up to the interface callbackDonald Sharp2019-09-191-21/+2
| | | | | | | For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Switch all zclient->interface_add to interface create callbackDonald Sharp2019-09-191-20/+2
| | | | | | | Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Add infrastructure to support zapi interface callbacksDonald Sharp2019-09-193-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-033-9/+5
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* vrrpd: eliminate potential null derefQuentin Young2019-08-051-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: try to bind interfaces on if_down notificationsQuentin Young2019-08-021-0/+4
| | | | | | | | | | | | | Normally we only opportunistically try to bind interfaces to VRRP instances upon getting if_add and if_up notifications; now that Zebra sends if_down notifications when interfaces change while they are down, we should try to bind when we get those as well. This solves a bug where VRRP would not bind and activate virtual routers to valid interfaces because their MACs were changed to VRRP macs while the interface was down. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: add more dbg logs around interfacesQuentin Young2019-08-022-4/+27
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: set interface ifindex to internal upon interface deletionQuentin Young2019-07-291-2/+2
| | | | | | That fix line should have been in a different place. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #4655 from qlyoung/fix-vrrp-iface-del-infiniteloopRenato Westphal2019-07-091-0/+2
|\ | | | | vrrpd: set interface ifindex to internal upon deletion
| * vrrpd: set interface ifindex to internal upon deletionQuentin Young2019-07-081-0/+2
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | vrrpd: use protocol number constantQuentin Young2019-07-081-2/+2
|/ | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: Allow vrrp to gracefully ignore access list commandsDonald Sharp2019-06-201-0/+1
| | | | | | | VRRPD was not gracefully ignoring any access-list commands. Modify the code so that it does. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* vrrpd: use MTYPE_STATICDavid Lamparter2019-06-219-67/+19
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* vrrpd: fix coverity warningsQuentin Young2019-05-173-5/+15
| | | | | | | | | * Suppress false positive on out of bounds access * Suppress false positive on unchecked str2sockunion * Remove self assignment * Initialze struct msghdr to zero Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: const vrrp_hash_keyQuentin Young2019-05-171-2/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: fix some clang-analyze warningsQuentin Young2019-05-171-1/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd, zebra: fix checkpatch warningsQuentin Young2019-05-173-7/+8
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: add 'show vrrp summary' commandQuentin Young2019-05-171-0/+69
| | | | | | Shows a brief summary table of all VRRP routers Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: fix memleak during config writeQuentin Young2019-05-171-0/+2
| | | | | | Forgot to free a list created in the course of writing our config. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: fix magnitude error when removing adver_intQuentin Young2019-05-171-1/+1
| | | | | | | When resetting advertisement interval back to the default, we were dividing centiseconds by 10 instead of milliseconds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: convert defaults command to millisecondsQuentin Young2019-05-172-4/+11
| | | | | | Missed this in the conversion from centiseconds to milliseconds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: fix global buffer overflow from style fixQuentin Young2019-05-171-1/+1
| | | | | | I knew I had done that for a reason Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: gracefully shutdown on SIGTERM / SIGINTQuentin Young2019-05-173-1/+29
| | | | | | | | Handle kill signals by gracefully destroying all of our VRRP instances. If any of them are in Master state, send an advert with 0 priority to notify Backup routers we are going down. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib, vrrpd: define & use ZEBRA_ROUTE_VRRPQuentin Young2019-05-171-1/+1
| | | | | | Allow Zebra to know our protocol name. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: use frr_elevate_privsQuentin Young2019-05-172-6/+3
| | | | | | Missed a few in the uplift. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd, lib: style fixesQuentin Young2019-05-178-25/+72
| | | | | | | | | Fixup: * Blank lines after declarations * Trailing whitespace * Braces and parentheses Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* doc: change vrrp to listen on port 2619Quentin Young2019-05-171-1/+1
| | | | | | 2617 was taken by BFD while VRRP was indev. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: include vrrp_packet.h in subdir.amQuentin Young2019-05-171-0/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: display configured adv int in json outputQuentin Young2019-05-171-0/+2
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: change all user facing times to msQuentin Young2019-05-173-24/+35
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: tweak startup criteria for v6 VRRP routerQuentin Young2019-05-171-2/+3
| | | | | | | | | | * Remove check for having at least 2 IPv6 addresses on the macvlan device; this was only taking place in v6, and breaking the ability to start VRRP on an IPv6 macvlan that was already set to protodown on * Improve log messaging indicating that we cannot start because we haven't got any VIPs configured Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: add asserts for VRRPv2 and IPv6Quentin Young2019-05-171-1/+4
| | | | | | Disallow adding IPv6 addresses to VRRPv2 routers. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: do not start v6 router if using VRRPv2Quentin Young2019-05-171-0/+3
| | | | | | v2 doesn't support IPv6. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: make useless assert usefulQuentin Young2019-05-171-1/+2
| | | | | | Assert would always come back true due to improper placement. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: late bind to Tx addressQuentin Young2019-05-171-85/+94
| | | | | | | Stupid stupid stupid. I can just bind to the Tx address right before I Tx, since if I've gotten there I know my link is up. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: fix v2 master_down_interval computationQuentin Young2019-05-171-1/+3
| | | | | | | | VRRPv2 uses the configured advertisement interval to compute the master down timer, whereas VRRPv3 uses the one advertised by the master. Fix computation to use the configured in in v2. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: include auth fields in v2 packetQuentin Young2019-05-172-10/+16
| | | | | | | | | | Based on looking at other vendors, seems I misinterpreted the RFC - type 0 auth (no authentication) still requires the authentication fields to be present, just set to all zero. This should fix VRRPv2 interop with other vendors. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: allow centisecond precision for vrrpv2Quentin Young2019-05-171-1/+1
| | | | | | | | | | | | | The RFC is not clear about how precise the skew time calculation should be in VRRPv2. The advertisement interval is given in seconds, and the field in the advertisement packet only supports non-fractional seconds, so I was following this for calculating skew time as well. However the skew time formula in vrrpv2 always yields a fractional amount of seconds in the range (0-1), which right now means we always truncate to 0 seconds. I doubt this is what the RFC wanted so I'm allowing centisecond precision for skew time. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: display primary address in json outputQuentin Young2019-05-171-2/+12
| | | | | | | | | And also, fill in the non-json output with a :: for the v6 primary since we're letting the operating system select which one it wants to use and we don't actually know what our primary address is. Another thing to revisit in the future... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Revert "Revert "vrrpd: protodown mvlans when shutting down""Quentin Young2019-05-171-0/+3
| | | | | | | | | Now that the requirement of knowing our VRRP IPv6 primary address in advance is lifted, it's no problem for us that the macvlans could be down when we get them. We can handle this in both the v4 and v6 case now, so we don't need to behave as if they should always be left up. This reverts commit 6eae67dabcbc31a2117ce3847c18ac52b3b76b1e.