]> git.proxmox.com Git - mirror_frr.git/commit - lib/vrf.c
*: modify VRF_CONFIGURED flag only in VRF NB layer
authorIgor Ryzhov <iryzhov@nfware.com>
Sun, 28 Mar 2021 21:49:13 +0000 (00:49 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Sun, 28 Mar 2021 21:52:39 +0000 (00:52 +0300)
commitb9b794db212d10390f4c79ab866dd4ea645353e9
tree2f301122f988e4e58160b87386c2db5b376469e1
parent45af60f0bbeadae78ff8f97ea638d3592e7605c9
*: modify VRF_CONFIGURED flag only in VRF NB layer

This is to fix the crash reproduced by the following steps:

* ip link add red type vrf table 1

  Creates VRF.

* vtysh -c "conf" -c "vrf red"

  Creates VRF NB node and marks VRF as configured.

* ip route 1.1.1.0/24 2.2.2.2 vrf red
* no ip route 1.1.1.0/24 2.2.2.2 vrf red
  (or similar l3vni set/unset in zebra)

  Marks VRF as NOT configured.

* ip link del red

  VRF is deleted, because it is marked as not configured, but NB node
  stays.

Subsequent attempt to configure something in the VRF leads to a crash
because of the stale pointer in NB layer.

Fixes #8357.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/vrf.c
lib/vrf.h
staticd/static_routes.c
staticd/static_vrf.c
staticd/static_vrf.h
zebra/zebra_nb_config.c
zebra/zebra_vrf.c
zebra/zebra_vrf.h