summaryrefslogtreecommitdiff
path: root/zebra
AgeCommit message (Collapse)Author
2020-04-30isisd: add support for segment routingRenato Westphal
This is an implementation of the IS-IS SR draft [1] for FRR. The following features are supported: * IPv4 and IPv6 Prefix-SIDs; * IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs; * Index and absolute labels; * The no-php and explicit-null Prefix-SID flags; * Full integration with the Label Manager. Known limitations: * No support for Anycast-SIDs; * No support for the SID/Label Binding TLV (required for LDP interop). * No support for persistent Adj-SIDs; * No support for multiple SRGBs. [1] draft-ietf-isis-segment-routing-extensions-25 Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-29Merge pull request #6314 from pjdruddy/fix-arp-cache-vtep-json-cliSri Mohana Singamsetty
zebra: fix json for show evpn arp-cache vni vtep
2020-04-29Merge pull request #5786 from mjstapp/fix_notif_empty_nhgStephen Worley
zebra: fix handling of failed route install via notification
2020-04-29Merge pull request #6309 from dslicenc/ra-retrans-intervalRuss White
zebra: add ability to set retransmit timer for IPv6 RAs
2020-04-29zebra: fix json for show evpn arp-cache vni vtepPat Ruddy
The function zebra_vxlan_print_neigh_vni_vtep does not create a json object when json has been requested from the CLI and as a result it prints out the information in normal CLI format. Fix is to allocate the json object when required. Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-04-29zebra: add ability to set retransmit timer for IPv6 RAsDon Slice
Reported by testing agency that rfc 4861 section 6.2.1 states that all implementations must have a configuration knob to change the setting of the advertised retransmit timer sent in RA packets. This fix adds that capability. Ticket: CM-29199 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-04-28zebra: fix zebra pseudowire manager NHTKaren Schoener
Intermittently, there is a 30 second delay for a LDP pseudowire to become operational. One way to reproduce the issue is: Once PW is up, shutdown link to trigger a change to the pseudowire's next hop, and then restore link to cause pseudowire to return to original NH. Problem Descripton: The Zebra PW manager installs pseudowires in the data plane when the following two conditions are met: 1. Pseudowire is labeled via LDP mapping messages 2. A labeled NH route exists to reach the remote pseudowire endpoint The Zebra PW manager registers a NHT callback when a pseudowire is enabled. This allows the Zebra PW manager to install or reinstall the pseudowire. The Zebra PW manager deregisters for the NHT callback when the pseudowire is disabled. When LDP learns the remote-pseudowire status is 'not forwarding', LDP notifies Zebra that the pseudowire is disabled. This creates a race condition where a new labeled NH can be resolved after the Zebra PW manager deregistered for the NHT callback. For static pseudowires, it makes sense for Zebra PW manager to deregister for NHT callbacks for disabled pseudowires. Static pseudowires become disabled via CLI configuration commands. For LDP pseudowires, the Zebra PW manager should not deregister for NHT callbacks for disabled pseudowires. Overview of changes: 1. Zebra PW manager should not deregister for NHT callbacks when an LDP pseudowire is disabled. Zebra PW manager will register for NHT callbacks when the LDP pseudowire is first enabled. Zebra PW manager will deregister for NHT callbacks when the LDP pseudowire is deleted. 2. Remove the 30 second timer that was added in PR4122. PR4122 tried to fix this race condition with a timer. Once we eliminate the race condition (by keeping the Zebra PW manager registered for NHT callbacks), this timer can be removed. 3. Zebra PW manager handling of static pseudowires will remain as-is. Zebra PW manager will register for NHT callbacks when the static pseudowire is enabled. Zebra PW manager will deregister for NHT callbacks when the static pseudowire is disabled. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-04-27zebra: fix handling of failed route install via notificationMark Stapp
An async route notification can indicate that installation has failed, but the handling code wasn't dealing with that possibility correctly. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-27*: fix first headerDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: make clippy Makefile rules nicerDavid Lamparter
These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: use VPATH for vtysh_scanDavid Lamparter
No need to put $(top_srcdir) everywhere. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-24Merge pull request #6279 from opensourcerouting/nb-cb-argsDonald Sharp
*: change the signature of the northbound callbacks to be more flexible
2020-04-23Merge pull request #6262 from qlyoung/remove-sprintfDavid Lamparter
2020-04-23*: change the signature of the northbound callbacks to be more flexibleRenato Westphal
Having a fixed set of parameters for each northbound callback isn't a good idea since it makes it difficult to add new parameters whenever that becomes necessary, as several hundreds or thousands of existing callbacks need to be updated accordingly. To remediate this issue, this commit changes the signature of all northbound callbacks to have a single parameter: a pointer to a 'nb_cb_x_args' structure (where x is different for each type of callback). These structures encapsulate all real parameters (both input and output) the callbacks need to have access to. And adding a new parameter to a given callback is as simple as adding a new field to the corresponding 'nb_cb_x_args' structure, without needing to update any instance of that callback in any daemon. This commit includes a .cocci semantic patch that can be used to update old code to the new format automatically. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22lib, zebra: add missing extern "C" {} blocks to new header filesRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22zebra: Prevent awful misconfiguration in vrf'sDonald Sharp
Currently the linux kernel allows you to specify the same table id -> multiple vrf's. While I am arguing with the kernel people about proper behavior here let's just remove this as a possiblity from happening and mark it a zebra stopable misconfiguration. (Effectively we are preventing a crash down the line as that all over FRR we assume it's a unique mapping not a many to one). Why fail hard? Because we hope to get the person who misconfigured it to actually notice immediately not hours or days down the line when shit hits the fan. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22zebra: Expose vrf lookup by table id out of rt_netlink.cDonald Sharp
The function rt_netlink.c is using to lookup the vrf by passed in table id. I'm also going to pretend that this function is not so awful to run when we have a large number of routes incoming. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-22zebra: Cleanup dead codeDonald Sharp
There are a couple of switch statements in netlink_route_info_encode in zebra_fpm_netlink.c that had logically dead code. We have a switch statement let's take actual advantage of it instead of doing gyrations to what we want. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-21Merge pull request #6253 from opensourcerouting/fpm-extraQuentin Young
zebra/fpm: fix shutdown and add more documentation
2020-04-20*: use appropriate buffer sizes, specifiersQuentin Young
- Fix 1 byte overflow when showing GR info in bgpd - Use PATH_MAX for path buffers - Use unsigned specifiers for uint16_t's in zebra pbr Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-20Merge pull request #6251 from opensourcerouting/cs-ignoreDonald Sharp
*: make coverity scan ignore random() calls
2020-04-18Merge pull request #6231 from dslicenc/v6-ra-hoplimitDonatas Abraitis
zebra: add ability to set hoplimit for IPv6 RAs
2020-04-17*: replace all random() callsRafael Zalamena
Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17zebra: gracefully shutdown fpm moduleRafael Zalamena
Lets stop and free all resources before shutting down. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-17zebra: notify data plane providers about shutdownRafael Zalamena
Call the `dp_fini` callback twice: once at the beginning of the shutdown and then again right before `exit()`ing zebra. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-16zebra: in_addr_cmp and `struct prefix` are not happyDonald Sharp
Coverity is complaining that we are looking beyond the end of the pointer. Why not just use prefix_cmp here? Since we are comparing to route_nodes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-16Merge pull request #6247 from FRRouting/nb_conversionsDonald Sharp
Merge nb_converions branch to master
2020-04-16Merge pull request #6135 from opensourcerouting/cli-node-cleanupDonald Sharp
*: clean up the mess that is CLI command nodes
2020-04-16Merge pull request #6224 from mjstapp/zclient_session_idOlivier Dugeon
lib,zebra: add a session id for zapi sessions
2020-04-16zebra,ldpd: use zapi client session id in LM apisMark Stapp
Use the zapi client session id in the label manager apis; use the client struct directly in some code. Assign a session id to ldpd's sync LM zapi session. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16lib,zebra: add a session id for zapi sessionsMark Stapp
Distinguish zapi sessions, for daemons who use more than one, by adding a session id. The tuple of proto + instance is not adequate to support clients who use multiple zapi sessions. Include the id in the client show output if it's present. Add a bit of info about this to the developer doc. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16zebra: add weight to nb conversionChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: add northbound support for zebra interfaceChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: add nb callbacks for zebra if stateChirag Shah
This is all stub callbacks autogenrated for zebra interface state data. Signed-off-by: chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: stub changes to assimilate re into rib nbChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: convert clear evpn dup addr command to nbChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: nb rpc cb for clear evpn dup addr cmdChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: clear dup detect cleanup for nb conversionChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: nb callbacks supportChirag Shah
Definition of the northbound callbacks and associated YANG data paths for zebra. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16*: frr nexthop yang in makefileChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16*: include vrf northbound module in initChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16zebra: fix FPM node reusing VTY_NODEDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-15zebra: add ability to set hoplimit for IPv6 RAsDon Slice
Reported by testing agency that rfc 4861 section 6.2.1 states that all implementations must have a configuration knob to change the setting of the advertised hop limit. This fix adds that capability. Ticket: CM-29200 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-04-15zebra: Modify netlink_request to statisfy coverityDonald Sharp
The netlink_request function takes a `struct nlmsghdr *` pointer from a common pattern that we use: struct { struct nlmsghdr n; struct fib_rule_hdr frh; char buf[NL_PKT_BUF_SIZE]; } req; We were calling it `netlink_request(Socket, &req.n)` The problem here is that coverity, rightly so, sees that we access the data after the nlmsghdr in netlink_request and tells us we have an read beyond end of the structure. While we know we haven't mangled anything up here because of manual inspection coverity doesn't have this knowledge implicitly. So let's modify the code call to netlink_request to pass in the void pointer of the req structure itself, cast to the appropriate data structure in the function and do the right thing. Hopefully the coverity SA will be happy and we can move on with our life. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>