]> git.puffer.fish Git - mirror/frr.git/commit
staticd: fix NB dependency hack 15279/head
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 1 Feb 2024 22:57:59 +0000 (00:57 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 1 Feb 2024 22:57:59 +0000 (00:57 +0200)
commitcb781f60972aca7e0fdd18884814a9ef0403a67c
tree8ae2c2b8d6701fee31088d86a39588534ecdfca4
parent5dfa36b6a7bf52041e61ea3bdcf8fd7c92fc61af
staticd: fix NB dependency hack

Currently, staticd configuration is tightly coupled with VRF existence.
Because of that, it has to use a hack in NB infrastructure to create a
VRF configuration when at least one static route is configured for this
VRF. This hack is incompatible with mgmtd, because mgmtd doesn't execute
configuration callbacks. Because of that, the configuration may become
out of sync between mgmtd and staticd. There are two main cases:

1. Create static route in a VRF. The VRF data node will be created
   automatically in staticd by the NB hack, but not in mgmtd.
2. Delete VRF which has some static routes configured. The static route
   configuration will be deleted from staticd by the NB hack, but not
   from mgmtd.

To fix the problem, decouple configuration of static routes from VRF
configuration. Now it is possible to configure static routes even if the
VRF doesn't exist yet. Once the VRF is created, staticd applies all the
preconfigured routes.

This change also fixes the problem with static routes being preserved in
the system when staticd "control-plane-protocol" container is deleted
but the VRF is still configured.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
12 files changed:
lib/routing_nb.h
lib/routing_nb_config.c
staticd/static_bfd.c
staticd/static_main.c
staticd/static_nb.h
staticd/static_nb_config.c
staticd/static_routes.c
staticd/static_routes.h
staticd/static_vrf.c
staticd/static_vrf.h
staticd/static_zebra.c
tests/lib/test_grpc.cpp