]> git.puffer.fish Git - matthieu/frr.git/commit
zebra: Get zebra graceful restart working when restarting on *BSD
authorDonald Sharp <sharpd@nvidia.com>
Sun, 27 Feb 2022 19:11:13 +0000 (14:11 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 28 Feb 2022 14:50:35 +0000 (09:50 -0500)
commit73d3197c7337e4c8d7f891b7ab0746da699734de
treee6b1c0b645286fa7904224f0b0e63a1b54c324fa
parent16d91fce151c16b81fa5554de9fec89dfc16ecae
zebra: Get zebra graceful restart working when restarting on *BSD

Upon restart zebra reads in the kernel state.  Under linux
there is a mechanism to read the route and convert the protocol
to the correct internal FRR protocol to allow the zebra graceful
restart efforts to work properly.

Under *BSD I do not see a mechanism to convey the original FRR
protocol into the kernel and thus back out of it.  Thus when
zebra crashes ( or restarts ) the routes read back in are kernel
routes and are effectively lost to the system and FRR cannot
remove them properly.  Why?  Because FRR see's kernel routes
as routes that it should not own and in general the admin
distance for those routes will be a better one than the
admin distance from a routing protocol.  This is even
worse because when the graceful restart timer pops and rib_sweep
is run, FRR becomes out of sync with the state of the kernel forwarding
on *BSD.

On restart, notice that the route is a self route that there
is no way to know it's originating protocol.  In this case
let's set the protocol to ZEBRA_ROUTE_STATIC and set the admin
distance to 255.

This way when an upper level protocol reinstalls it's route
the general zebra graceful restart code still works.  The
high admin distance allows the code to just work in a way
that is graceful( HA! )

The drawback here is that the route shows up as a static
route for the time the system is doing it's work.  FRR
could introduce *another* route type but this seems like
a bad idea and the STATIC route type is loosely analagous
to the type of route it has become.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/kernel_socket.c