summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-17vrrpd: fix broken reads when reinitializingQuentin Young
When a VRRP router was shut down - either due to an administrative event, or its interface getting deleted, or some other reason - it was forgetting to cancel its read task. When it was started again, the read task was still around, and so it wasn't getting scheduled again with the new socket fd's. This caused our socket to queue ingress packets but never read them, resulting in the restarted router always electing itself to Master (since it wasn't listening to any other advertisements, even though the kernel was delivering them). The t_write cancellation call doesn't matter here, but I'm putting it in there because it doesn't hurt and this way I won't forget about it if it becomes necessary in the future. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vtysh: don't sort vrrp interface configQuentin Young
It is order dependent Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix debug message = -> <=Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: delay sending advert/garp/una for ifup pt 2Quentin Young
Pt 2: When transitioning directly into Master (because we are the address owner), wait until Zebra sets the macvlan device to protodown off before transmitting advertisements, gratuitous ARPs, or Unsolicited Neighbor Advertisements. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: delay sending adverts/garp/una for iface upQuentin Young
When transitioning to Master from Backup, wait until Zebra sets the macvlan device to protodown off before transmitting advertisements, gratuitous ARPs, or Unsolicited Neighbor Advertisements. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: allow user to set priority = 255Quentin Young
Too many problems with implicit ownership determination via duplicate address assignment. Will revisit that in the future. For now, allow user to specify 255 as a priority value. This is functionally no different than any other priority value; it just serves as a self-documenting way of saying you want one router to always be master. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix sign compare on armelQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix interface block config writesQuentin Young
Improper reuse of list node broke config writes of multiple instances Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix autoconfig of protodown'd interfacesQuentin Young
When autoconfiguring VRRP, interfaces that are protodown'd should be automatically brought up. Otherwise Zebra won't send us their interface addresses and we'll sit in Initialize forever. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add more debugging infoQuentin Young
* Add reason why we are discarding adverts * Add primary IP to show vrrp output Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix unsigned - signed cmpQuentin Young
For some reason this warning only shows up on armel Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: check start for manual v6 addr addQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: use parent interface LLA for advert txQuentin Young
Interface MACs for v6 macvlan devices are the same, so the link local address will be the same, which breaks mastership election based on primary address comparison. Use the parent interface link local address. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: only update one vrrp_router list at a timeQuentin Young
When using an autoconfigured VRRP instance, when an interface address was added or deleted we were trying to update the address list for both v4 and v6 vrrp_router's which sometimes would cause all the addresses to get deleted off of one of them and result in an automatic shutdown. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: set autoconfed VRRP ifaces protodown offQuentin Young
If we just detected a macvlan and used it to automatically create an interface, set that interface into protodown off. This way users don't have to manually bring the interface back up in order to get autoconfig to work again. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix bad fmt specifiers in dgram validatorQuentin Young
They used a %u where they should have used a PRIu16, and a %lu where they wanted a %zu. Shame! Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: log why vrouter could not be startedQuentin Young
If we do a checkstart and cannot start the VRRP router, log the reason why for debugging purposes. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: be less smart about interface stateQuentin Young
Stop caring about interface state so much. It's screwing up autoconfig because Zebra's message semantics are pretty much absolute nonsense when it comes to indicating interface state. This change will cause us to do things like attempt to transmit advertisements on a down interface, but I'd rather have the user see those error messages in the log file than force them to fight vrrpd to convince it that, yes, they actually do want a VRRP instance created. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: style cleanupQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: allow configuring global defaultsQuentin Young
Allow configuring the following as global defaults: - Priority - Advertisement interval - Preempt mode - Administrative shutdown Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add statistics collectionQuentin Young
Collect and display the following: - Advertisement Tx/Rx - GARP Tx/Rx - NDISC Tx/Rx - # transitions Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: follow frrouting json conventionsQuentin Young
Use camelCase for json keys Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: do not transition to backup on ifdownQuentin Young
Transitioning to backup on an interface down causes all sorts of problems when it comes back up, not least of which is breaking preempt mode. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: stop session before nulling ifaceQuentin Young
When an interface is deleted from the system, stop any attached VRRP sessions before nulling out the interface fields. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: cleanup formatting for vty show cmdQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add json support to show commandQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib: add more convenient boolean adder for jsonQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: default to accept mode = trueQuentin Young
We have no facilities to enforce accept mode = false yet so this is updated to reflect the actual state of the system. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add administrative shutdown optionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: don't update interface addrs on ifupQuentin Young
Updating interface addresses on autoconfigured VRRP instances when we receive notification that an interface is up will cause us to delete that VRRP instance because Zebra deletes all interface addresses when an interfaces goes down so when it comes back up it has no addresses which causes us to delete the instance, then Zebra subsequently sends us the addresses which causes the instance to get recreated, however in a non-owner scenario this will merely cause us to start in Backup, wait a while, transition to Master, protodown off our interface, get an interface up notification, delete all our ip addresses, destroy ourselves, receive address notifications, recreate ourselves, reenter Backup and cycle through it all over again. So we just have to assume that no addresses went away since this interface was last up. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: use if_is_operative()Quentin Young
Checks for interface usability instead of admin state, which is what I wanted anyway. Also removes the operstate check when binding interfaces. This way we can bind currently inoperative interfaces, won't start until they're at least admin up, but *will* start if they're carrier down, because we can fix that (and probably caused it :) Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: enable vrrp zebra debuggingQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: ignore address deletion if iface is downQuentin Young
See code comment for explanation Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: check for v6 link-local before startingQuentin Young
Having a v6 link-local is a precondition for starting a v6 VRRP router; check that we do. Also add some helpful comments to the check-start function because good lord that thing is getting unwieldy. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: tweak interface tracking on ifdownQuentin Young
Change the interface tracking code to react to an interface down by automatically transitioning to Backup, instead of shutting down the session. This is because we get ZEBRA_INTERFACE_DOWN messages when we set an interface to protodown as part of transitioning to Backup; if we shut down the session in response to these messages, we end up shutting ourselves down every time we try to transition to Backup. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: only bind to link locals for v6 advertsQuentin Young
Was missing a check to make sure that the v6 address we select as the source IP for advertisements was a link local address Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: interface trackingQuentin Young
* Dynamically bind interfaces when they become available * Automatically start VRRP sessions when their interfaces are added or come up * Automatically shut down VRRP sessions when their interfaces are deleted or go down * Automatically unbind interfaces when they are deleted Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: better messaging for interface bindsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: skip binding interface after createQuentin Young
When automatically creating new VRRP instances, we don't need to try to bind them to macvlan interfaces again. We only need to do that when we got notified that a new interface came up and want an existing VRRP instance to update its interface bindings. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: close sockets on shutdownQuentin Young
When shutting down a VRRP router, kill the sockets as well. Too dangerous to try to reuse them. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: log addresses for autoconfigQuentin Young
When adding and removing addreses. log them. Also include a VRID tag when autoconfiguring new instances. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix incorrect index for vrrp event namesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: update auto*, init scripts, etcQuentin Young
Add vrrpd to all the usual places daemons need to go Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix err messaging for ipv6 addr addQuentin Young
* Add newline to message * Change pasted IPv4 to IPv6 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add support for configuration writingQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: remove ifindex from hash key computationQuentin Young
Ifindexes apparently change more often than one might expect and so are not suitable for use in hash keys. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: set DSCP byte on adverts to CS6Quentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: properly retrieve pkt src addressQuentin Young
* Fix null dereference when retrieving IPv6 source address * Change IPv4 code path to use system-specified source address instead of the one delivered in the IPv4 raw header Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: fix bug in v6 autoconfigurationQuentin Young
Typo caused the IPv4 VRRP router to be shutdown instead of the IPv6 one, and sometimes a crash. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: use debugging knobsQuentin Young
* Gate all debugging messages with the debugging system * Simplify a bit of debugging where it was easy to do inline Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>