| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: correct update static route when specify nexthop-vrf
|
| |
| |
| |
| | |
Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
If we are told that a dependant nexthop has changed, just
reinstall the route.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
| |
- 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 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
|
|
|
|
|
|
|
|
| |
Think we got it all this time. Null0 is shown as a CLI option, and any
capitalization of Null0 (such as null0, nuLl0, etc) is accepted to mean
Null0.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|\
| |
| | |
staticd: install static routes in a vrf when next-hop interface comes up
|
| |
| |
| |
| | |
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem reported with cross-vrf static routes that the routes weren't
installed when the target interface is bounced. Determined that we did
not initiate re-install of the statics in that particular case, so added
it. Test case previously failing now passes.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
|
|/
|
|
|
|
|
| |
It's been a year since we added the new optional parameters
to instantiation. Let's switch over to the new name.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
| |
FRR_DAEMON_INFO should now contain an array of 'frr_yang_module_info'
structures describing the YANG modules implemented by the daemon.
This array will be used by frr_init() function to load all YANG modules
and initialize the northbound callbacks during the daemon initialization.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
|
|\
| |
| | |
vtysh: fix exit-vrf printing
|
| |
| |
| |
| |
| |
| |
| |
| | |
Resolves issue with exit-vrf being placed at the end of zebra's portion
of a vrf block, but before other daemons' portions of the same config
block.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|/
|
|
|
|
|
| |
Missed a cherry-pick somewhere, `onlink` was never actually displayed in
the config although it could be configured.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
| |
The ->hash_cmp and linked list ->cmp functions were sometimes
being used interchangeably and this really is not a good
thing. So let's modify the hash_cmp function pointer to return
a boolean and convert everything to use the new syntax.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The table_id should be a discriminator in the installation of
static routes into zebra from staticd. Add this to allow the end
user to do something like this:
ip route 4.5.6.7/32 192.168.209.44
ip route 4.5.6.7/32 192.168.209.44 table 3000
ip route 4.5.6.7/32 192.168.209.45 table 3000
robot# show ip route
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
K>* 0.0.0.0/0 [0/101] via 192.168.201.1, enp0s3, 00:01:40
S>* 4.3.2.1/32 [1/0] via 192.168.210.4, enp0s10, 00:01:35
S>* 4.3.2.2/32 [1/0] via 192.168.209.4, enp0s9, 00:01:35
S>* 4.5.6.0/26 [1/0] via 192.168.210.4, enp0s10, 00:01:35
S>* 4.5.6.7/32 [1/0] via 192.168.209.44, enp0s9, 00:01:35
C>* 192.168.201.0/24 is directly connected, enp0s3, 00:01:40
C>* 192.168.208.0/24 is directly connected, enp0s8, 00:01:40
C>* 192.168.209.0/24 is directly connected, enp0s9, 00:01:40
C>* 192.168.210.0/24 is directly connected, enp0s10, 00:01:40
robot# show ip route table 3000
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
S>* 4.5.6.7/32 [1/0] via 192.168.209.44, enp0s9, 00:00:55
* via 192.168.209.45, enp0s9, 00:00:55
robot#
Fixes: #2954
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
| |
Can't build manpages without sphinx-build, oops...
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|\
| |
| | |
final non-recursive make
|
| |
| |
| |
| |
| |
| |
| | |
Since we're now building through one large Makefile, we can easily put
things with their daemons and crossreference nicely.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|/
|
|
|
|
|
| |
I don't see these in CI, but my local clang-6 does emit warnings for
these.
Signed-off-by: David Lamparter <equinox@diac24.net>
|
|
|
|
|
|
|
|
| |
'show debugging' is returning a Command incomplete
error message as that it is being sent to staticd
and staticd has no knowledge of it, fix this.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we store the nexthop for ref-counting, keep
track of the nexthop vrf_id as well. This will allow
us to track the nexthop per vrf!
Additionally when we get the callback from zebra about
a nexthop update, iterate over all static routes to
see if the nexthop we are getting a callback is
one we are concerned about.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
| |
The Vrf aliases can be known with a specific hook. That hook will then,
from zebra propagate the information to the relevant zapi clients.
The registration hook function is the same for all daemons.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we add / remove a nexthop that we need to track,
keep track of the number of times we have done this
for each nexthop. Consequently keep track of the
number of available nexthops, so that we can
just install new routes when we get one
that uses a pre-existing nexthop. Deletion of
nexthops is done on refcount going to 0.
Removal of routes is handled elsewhere for removal.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|