Age | Commit message (Collapse) | Author |
|
ctx is leaked in case of an allocation in prefix_dump_new,
prefix_dump_subtree, rib_dump_new, or rib_dump_subtree fails.
Found by CodeChecker.
OK claudio@
|
|
bgpd and ldpd.
Found by CodeChecker.
OK claudio@
|
|
OK claudio@
|
|
for peers that never managed to establish a connection.
OK tb@
|
|
Thanks Marco D'Itri for spotting them
OK claudio@
|
|
ok miod@ claudio@ tb@
|
|
|
|
With this bgpd.h no longer depends on net/route.h
OK tb@
|
|
The generic add-path code up_generate_addpath() reevaluates everything
since this is the simplest way to select the announced paths. For add-path
all this is overkill since there is no dependency between prefixes and so
individual prefixes can be handled more efficently.
Extend rde_generate_updates() to pass the current newbest and oldbest
prefixes (for the selected best path) but now also include newpath and
oldpath (which is the prefix that is added/removed/modified).
If newpath or oldpath is set then a single prefix was altered and
up_generate_addpath_all() can just remove or add this prefix.
If newpath and oldpath are NULL than the full list based on newbest
needs to be inserted and any old path/prefix removed in the process.
This improves update generation performance on big route collectors using
add-path all substantially.
OK tb@
|
|
the RTP_BGP and similar defines all into kroute.c and export them via
kr_default_prio() and kr_check_prio().
OK tb@
|
|
Use a per peer path_id_tx to assign to paths received from none add-path
enabled peers. This skips two extra walks of the RIB prefix list and is
a big speed-up when there are many regular sessions. If the session uses
add-path recv then the old way of assigning random path_ids needs to be
used.
With input and OK tb@
|
|
Connected routes have no gateway set but only have ifindex set.
When an interface is deconfigured this makes sure the right route is
removed.
OK tb@
|
|
|
|
In some cases only a "small" part of the RIB needs to be looked at. Like
bgpctl show rib 10/8 or-longer that only needs to travers nodes under
10/8 all other RIB entries do not matter. By setting the start node to
the RB_NFIND(10/8) the all nodes below this point can be skipped.
Using prefix_compare() while walking the tree with RB_NEXT() the walker
know when it steps outside of the 10/8 subtree and stops.
With this the or-longer commands become a lot faster.
Looks good to tb@
|
|
prefixlen. Even for IPv6 this is much faster than a full table walk.
OK tb@
|
|
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@
|