Age | Commit message (Collapse) | Author |
|
Only the RDE used a hashtable for lookups while the session engine
switched from a list to RB tree some time ago.
Use peer_foreach() in the mrt code instead of passing the peer list
as an argument.
OK benno@ tb@
|
|
prototypes and members that were not removed in the previous RB tree
conversions.
OK benno@ tb@
|
|
longer used. Also cleanup some hash sizes which are also no longer used.
OK tb@
|
|
OK benno@ tb@
|
|
If a run takes to long drop the current update and wait for the next update.
OK benno@
|
|
OK benno@
|
|
|
|
|
|
struct. It uses a bit more memory but improves performance a lot on really
big systems because aspath_get() becomes a very hot function.
OK tb@
|
|
OK tb@
|
|
undersized hash table.
OK tb@
|
|
OK tb@
|
|
OK tb@
|
|
them on the per peer imsg queue. This is mainly for IMSG_SESSION_DOWN.
Delaying the session down can race against IMSG_SESSION_ADD which is
handled immediatly and as a result an establised connection may be
removed in the RDE because of it.
The various graceful restart imsgs need similar treatment for similar
reasons. In the end when a session is reset/closed the RDE needs to
stop all work and flush the per peer imsg queue.
With this only update and route refresh messages are handled via the
imsg queue.
OK tb@
|
|
the nexthop from the covering route. Move this logic from RDE to the
kroute code so it is all in one place.
OK tb@
|
|
In many cases the message is just flooding the logs. In some cases it may
help to identify a missing neighbor for those cases log verbose can be used.
OK deraadt@ denis@
|
|
In knexthop_true_nexthop() connected routes need to be handled specially.
If a nexthop is directly reachable the gateway needs to remain the same.
There is no nexthop set for F_CONNECTED kroutes. A very similar trick
is used in rde_rib.c::nexthop_update() but was forgotten here.
Regression noticed by Daniel Jakots (danj at chown.me).
OK tb@
|
|
since krm is only set for IPv4 routes but not for IPv6 ones.
OK tb@
|
|
one from kr_state and removing this argument helps portability.
OK tb@
|
|
The memory regions passed to memcpy() can not overlap so no need for memmove().
OK tb@ deraadt@
|
|
struct.
OK tb@
|
|
|
|
|
|
instead use exit_nexthop (the nexthop from BGP). The FIB code can then
do the lookup and replace the nexthop in the FIB.
This solves an issue when multiple nexthops change concurrently. In the
RDE the decision process handles these changes ansynchronously which
resulted in bad true_nexthops to be sent to the FIB. The exit_nethop
is stable so the data sent to the FIB is always correct.
Fix a bug in netxhop tracking introduced in 1.280. On RTM_CHANGE when the
nexthop of a kroute changes a knexthop_send_update() must be sent but
knexthop_track() does not do that because the kroute did not change.
Introduce a knexthop_update() function for this case instead.
OK tb@
|
|
This matches the VPN4 code and avoids a NULL deref in the else branch.
ok claudio
|
|
memcpy(). Additionally replace a bzero() with memset() and remove to
superfluous bzero calls.
OK tb@
|
|
The nexthop can be valid but still a NULL pointer. In that case just set
the aid like it is done for invalid nexthops. If the nexthop is set by
explicitly specifying one then include the exit_nexthop, that is the
nexthop that is relevant for BGP. Further cleanup the function as usual.
OK tb@
|
|
|
|
knexthop_validate() will modify the kroute the nexthop points to.
Because of this knexthop_validate() needs to be called before the
to be removed kroute is freed. Move the code into kroute_remove[46]
so the order is correct.
Problem found and fix tested by sthen@.
OK sthen@ tb@
|
|
kroute_match() may return NULL so setting kn->ifindex should only
be done if the kroute is valid. Also set the ifindex to 0 in
kroute_detach_nexthop().
Based on a bigger diff which is OK tb@ and sthen@
|
|
the work internally. Removes a bunch of duplicated code and simplifies
code further.
Input and OK tb@
|
|
|
|
to group them a bit better.
OK tb@
|
|
Remove F_KERNEL and replace the checks using the F_BGPD flag.
Also do not convert the priority in kr_tofull() instead provide
kr_priority() which does this and is used by the bgpctl imsg
commands. Also in dispatch_rtmsg_addr() convert to RTP_MINE if
the priority is equal to the configured priority.
OK tb@
|
|
Therefor check that in the IFAN_DEPARTURE case the interface was found
before calling kif_remove.
Idea and OK tb@
|
|
|
|
need to track directly connected routes per kif. The only use case was
for nexthop validation but that can be done by storing the ifindex in
struct knexthop.
OK tb@
|
|
In rev 1.90 of rde_decide.c the re->active cache of the best prefix was
replaced with a call to prefix_best(). This introduced a bug because the
nexthop state at that time may have changed already. As a result when
a nexthop became unreachable prefix_evaluate() had oldbest = NULL and
newbest = NULL and did not withdraw the prefix from FIB and Adj-RIB-Out.
To fix this store the nexthop state per prefix and introduce
prefix_evaluate_nexthop() which removes the prefix from the decision list,
updates the nexthop state of the prefix and reinserts the prefix. Doing
this ensures that prefix_best() always reports the same result once the
decison process is done. prefix_best() and prefix_eligible() only depend
on data stored on the prefix itself.
OK tb@
|
|
Simplify the logic and adjust kroute_match() which makes the code
easier to understand.
OK tb@
|
|
From a previous diff that was reverted because of a different issue.
was OK tb@
|
|
not correct because kr_tofull() replaces RTP_MINE with the real priority.
Noticed because of incorrect nexthop selection.
|
|
Only problem is when route(8) is used to modify/delete a bgpd owned route.
Exact behaviour for that is still a bit unclear but F_KERNEL does not help
in this case either. In the kr_fib_delete/change remove F_BGPD_INSERTED
in that case as a first step.
OK tb@
|
|
add-path send is kind of like rde evaluate all (at least if plus is used)
and so it kind of implies 'rde evaluate all' in that case. Removing the
check in neighbor_consistent() allows to setup sessions so that 'either or'
are used. This makes sense since peers may opt out of add-path by disabling
the capability on their side.
Based on report from Pier Carlo Chiodi
OK tb@
cvs: ----------------------------------------------------------------------
|
|
struct kroute_full. This removes some of the duplicated code.
OK tb@
|
|
- introduce network_free() to properly free a network struct including
the possible rtlabel reference.
- change expand_networks() and the reload code to not only expand the
main network config but also the network configs inside L3VPN sections.
- adjust reload logic to properly match any kind of network struct.
Up until now rtlabel and priority network statememnts were not correctly
reloaded.
OK tb@
|
|
Check both for negative pos and for pos bigger or equal to the segment length
With and OK tb@
|
|
OK tb@
|
|
discussed with tb
|
|
If the RDE dies this is logged before but the error messages from
imsg_rde() may be called a couple of times before the SE has a chance
to exit.
OK tb@
|
|
The list of invalid prefixes is not properly sorted and when those prefixes
all become valid the list is not properly sorted until the nexthop update
pass is done. Found the hard way by myself.
OK tb@ benno@
|