summaryrefslogtreecommitdiffstats
path: root/staticd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: include vrf northbound module in initChirag Shah2020-04-161-0/+1
| | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: use the current project name (FRRouting)Lou Berger2020-03-252-2/+2
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* staticd: fix vty help textMark Stapp2020-03-231-4/+4
| | | | | | | Missing newline in some vty help text, resulted in garbage in help output. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* Merge pull request #5933 from rgirada/frr-staticDonald Sharp2020-03-083-0/+9
|\ | | | | staticd: Fixing memory leak issue
| * staticd: Fixing memory leak issuergirada2020-03-083-0/+9
| | | | | | | | | | | | | | Memory allotted for staticd specific vrf structers is not being deallocated when the corresponding vrf is destroyed. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | staticd: fix build on Fedora RawhideRuben Kerkhof2020-03-071-1/+1
|/ | | | | | | | | | | | Fixes the following linker issue: CC staticd/static_main.o CC staticd/static_debug.o CC staticd/static_vty.o AR staticd/libstatic.a CCLD staticd/staticd /usr/bin/ld: staticd/libstatic.a(static_debug.o):/home/ruben/src/frr/staticd/static_debug.h:32: multiple definition of `static_dbg_events'; staticd/static_main.o:/home/ruben/src/frr/staticd/static_debug.h:32: first defined here Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp2020-03-061-1/+1
| | | | | | FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis2020-03-052-25/+21
| | | | | | Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* doc: rename man pages to frr-*David Lamparter2020-01-151-1/+1
| | | | | | | | The vrrpd one conflicts with the standalone vrrpd package; also we're installing daemons to /usr/lib/frr on some systems so they're not on PATH. Signed-off-by: David Lamparter <equinox@diac24.net>
* staticd: add debug supportMark Stapp2020-01-095-4/+233
| | | | | | | Add initial debug support to staticd, using the lib/debug form of debug support. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: revise zapi nexthop encodingMark Stapp2019-12-061-2/+3
| | | | | | | | Use a per-nexthop flag to indicate the presence of labels; add some utility zapi encode/decode apis for nexthops; use the zapi apis more consistently. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: make frr_yang_module_info constDavid Lamparter2019-11-301-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* staticd: remove unneeded newline from zlog callTrey Aspelund2019-11-201-1/+1
| | | | | | PR 5303 was merged before the newline was removed from the zlog call. Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
* staticd: Make blackhole keyword errors more straightforwardTrey Aspelund2019-11-141-2/+2
| | | | | | | | Previous error was misleading and made it seem like Null0, reject, or blackhole nexthops on static routes are invalid. This commit makes it more clear as to why the error is seen. Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
* staticd: exact match on magic interface namesQuentin Young2019-11-081-3/+3
| | | | | | Don't do a substring match on magic interface names - do an exact match. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: Convert connected_free to a double pointerDonald Sharp2019-11-021-1/+1
| | | | | | Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert prefix_free to double pointerDonald Sharp2019-11-021-1/+1
| | | | | | Have the prefix_free code take a double pointer to free the data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* staticd: check tuple (vrf, name) when interface events receivedPhilippe Guibert2019-10-231-0/+4
| | | | | | | | | with network namespace vrf backend, there is possibilities that the same interface name can be used across two different vrfs. Then, enforce the check when static daemon receives interface events. Adding to the interface name, check for the vrf id, too. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Merge pull request #5009 from donaldsharp/interface_deletionRuss White2019-09-301-60/+18
|\ | | | | lib, zebra: Allow for interface deletion when kernel event happens
| * *: Convert zapi->interface_delete to ifp callbackDonald Sharp2019-09-191-20/+1
| | | | | | | | | | | | | | 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-13/+2
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * *: Convert from ->interface_up to the interface callbackDonald Sharp2019-09-191-33/+9
| | | | | | | | | | | | | | 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-14/+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-191-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | staticd: register to interface events related with non default vrfPhilippe Guibert2019-09-173-0/+21
|/ | | | | | | | | in addition to non default vrf, once a new vrf is available, the static daemon registers to events from that vrf, including presence of interfaces. this permits to create static route with nexthop=interface. Reversely, an unregistration is scheduled too when vrf disappears. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Merge pull request #4722 from ak503/staticDonald Sharp2019-09-111-1/+2
|\ | | | | staticd: correct update static route when specify nexthop-vrf
| * staticd: correct update static route when specify nexthop-vrfDmitrii Turlupov2019-08-281-1/+2
| | | | | | | | Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
* | staticd: static route config should fail if gw configured as its local ip.rgirada2019-09-072-1/+42
| | | | | | | | | | | | | | | | | | | | | | Fix: Added a check in staticd upon receiving nexthop update from zebra such that it will fail to resolve the nexthop if the connected address added as nexthop. But still allowing to add to staticd database and appears in running config. Throwing an warning massage to user if such misconfig issued. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | staticd: Re-send/Remove routes on interface eventsStephen Worley2019-09-041-1/+7
| | | | | | | | | | | | | | | | We were not processing interface up/down events for device only static routes. This patch looks up the ifp and then calls the same API we are using for interface add/remove events. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* | pbrd, sharpd, staticd: Add some color to sample configuration filesDonald Sharp2019-08-191-1/+3
| | | | | | | | | | | | | | | | The sample configuration files for pbrd, sharpd and staticd where all the same. Add some bit of color to help new people get rolling on these three daemons. Signed-off-by: Donald Sharp <sharpd@cumulusnetwork.com>
* | staticd: Fix blackhole routes being installedDonald Sharp2019-08-081-3/+21
| | | | | | | | | | | | | | | | | | | | | | When we are ready to install a route, we were treating blackhole routes as something that should be nexthop tracked which does not work as well as one would expect. Additionally add some test code to show that this actually fixes this issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | staticd: Track state of where we are and limit installs/updates to minDonald Sharp2019-07-163-1/+121
| | | | | | | | | | | | | | | | Track the state of the route and how we have installed it or not. This commit limits the number of installs/updates/deletes to a minimum number instead of repeated sends to zebra. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | static: Start state tracking to know what we think the route is doingDonald Sharp2019-07-161-0/+26
| | | | | | | | | | | | | | | | We need to track the state information in staticd of what we think the route is. Add the enum for this state and place it into the si. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | staticd: Setup nexthop tracking instead of installing routeDonald Sharp2019-07-162-2/+7
| | | | | | | | | | | | | | | | | | | | Route installs should be handled by the setup of nexthop tracking instead of installing the route and then installing the nexthop tracking again ( and reinstalling the route ) This change makes routes be installed one time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | staticd: Fix static_nht_update to actually know route we are installingDonald Sharp2019-07-165-36/+70
|/ | | | | | | | | | | We are using static_nht_update in two different cases: 1) We have received a callback that a nexthop has changed and we need to find any static route that is using it and we must refigure it. 2) We have received a new static route that depends on a pre-existing nexthop, in which case we can go straight to the chase and just refigure that particular node, since we already have all the information we need. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* staticd: If we are told a nexthop has changed reinstall the route.Donald Sharp2019-06-241-12/+1
| | | | | | | If we are told that a dependant nexthop has changed, just reinstall the route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Revert "Ospf missing interface handling 2"Donald Sharp2019-06-242-10/+9
|
* *: change interface structure, from vrf_id to vrfPhilippe Guibert2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Field vrf_id is replaced by the pointer of the struct vrf *. For that all other code referencing to (interface)->vrf_id is replaced. This work should not change the behaviour. It is just a continuation work toward having an interface API handling vrf pointer only. some new generic functions are created in vrf: vrf_to_id, vrf_to_name, a zebra function is also created: zvrf_info_lookup an ospf function is also created: ospf_lookup_by_vrf it is to be noted that now that interface has a vrf pointer, some more optimisations could be thought through all the rest of the code. as example, many structure store the vrf_id. those structures could get the exact vrf structure if inherited from an interface vrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: change if_lookup_by_name() api with vrfPhilippe Guibert2019-06-122-7/+8
| | | | | | | | | | the vrf_id parameter is replaced by struct vrf * parameter. this impacts most of the daemons that look for an interface based on the name and the vrf identifier. Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was ignored until now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* staticd: strcpy -> strlcpyQuentin Young2019-05-291-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: hashing functions should take const argumentsQuentin Young2019-05-141-2/+2
| | | | | | | | | | It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young2019-05-031-18/+10
| | | | | | | | | | | | This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* staticd: Allow reinstall of static nexthops on vrf restartDonald Sharp2019-04-041-0/+1
| | | | | | | | | | When staticd receives notification that a vrf that it is using is back up into a state that can be used, go through and mark all the si data structures nexthops as not installed. This will allow us to complete the loop and reinstall routes that need to be fully resolved. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* staticd: Fix static routes that are not added in RIB after Null0 or vrf routesAdrian Ban2019-04-031-2/+2
| | | | | | | | | | | | | | When you add a static route like: ip route 10.0.0.0/24 Null0 ip route 192.168.7.0/24 99.99.99.99 nexthop-vrf EVA all routes after this command will be ignored by staticd and are not inserted in RIB. This is the cause of return instead of continue in the for loop in static_nht_update_safi() function that is stopping the search in the routes list and is returning in the previous function without calling static_zebra_route_add() function. This patch is fixing this issue. Signed-off-by: Adrian Ban <bugs@abtelcom.ro>
* *: remove null check before XFREEQuentin Young2019-02-261-24/+12
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* build: fix a whole bunch of *FLAGSDavid Lamparter2019-01-301-1/+1
| | | | | | | | | - some target_CFLAGS that needed to include AM_CFLAGS didn't do so - libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all - consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@ - 2 dependencies were missing for clippy Signed-off-by: David Lamparter <equinox@diac24.net>
* *: The onlink attribute should be owned by the nexthop not the route.Donald Sharp2019-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The onlink attribute was being passed from upper level protocols as an attribute of the route *not* the individual nexthop. When we pass this data to the kernel, we treat the onlink as a attribute of the nexthop. This commit modifies the code base to allow us to pass the ONLINK attribute as an attribute of the nexthop. This commit also fixes static routes that have multiple nexthops some onlink and some not. ip route 4.5.6.7/32 192.168.41.1 eveth1 onlink ip route 4.5.6.7/32 192.168.42.2 S>* 4.5.6.7/32 [1/0] via 192.168.41.1, eveth1 onlink, 00:03:04 * via 192.168.42.2, eveth2, 00:03:04 sharpd@robot ~/frr2> sudo ip netns exec EVA ip route show 4.5.6.7 proto 196 metric 20 nexthop via 192.168.41.1 dev eveth1 weight 1 onlink nexthop via 192.168.42.2 dev eveth2 weight 1 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: remove the vrf_is_mapped_on_netns() functionRenato Westphal2019-01-201-12/+12
| | | | | | | | | | | | | | | | | Now that all daemons receive the VRF backend from zebra, we can get rid of vrf_is_mapped_on_netns() in favor of using the more convenient vrf_is_backend_netns() function, which doesn't require any argument. This commit also fixes the following problem: debian(config)# ip route 50.0.0.0/8 blackhole vrf FAKE table 2 % table param only available when running on netns-based vrfs Even when zebra was started with the --vrfwnetns, the error above would be displayed since the VRF FAKE didn't exist, which would make vrf_is_mapped_on_netns() return 0 incorrectly. Using vrf_is_backend_netns() this problem doesn't happen anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* staticd: Fix nht to include SAFI_MULTICASTDonald Sharp2019-01-041-37/+46
| | | | | | | | | | | | | | | | | | | | | | | | The nexthop tracking was correctly registering the nexthops in the SAFI_UNICAST table, but we need to apply them to the SAFI_MULTICAST mroute information( if any ) as well. donna.cumulusnetworks.com# conf t donna.cumulusnetworks.com(config)# ip mroute 230.0.4.0/24 192.168.210.50 donna.cumulusnetworks.com(config)# end donna.cumulusnetworks.com# show ip rpf Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route C>* 10.0.2.0/24 is directly connected, enp0s3, 00:08:28 C>* 192.168.209.0/24 is directly connected, enp0s8, 00:08:28 C>* 192.168.210.0/24 is directly connected, enp0s9, 00:08:28 S>* 230.0.4.0/24 [1/0] via 192.168.210.50, enp0s9, 00:07:56 S>* 230.0.5.0/24 [1/0] via 192.168.210.50, enp0s9, 00:07:17 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* staticd: Do not ready prefix for printing till it's decodedDonald Sharp2018-12-291-2/+2
| | | | | | | | The static daemon is setting up the prefix for printing before it is decoded when we get notified about our route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>