]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: fix import vrf creates multiple bgp instances
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 9 Jan 2025 09:26:02 +0000 (10:26 +0100)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Sun, 2 Feb 2025 18:57:56 +0000 (20:57 +0200)
commit5c6a4947ebc71f8e7f55634d82865e7109cab8ca
tree502d47871f1c0c2e3297c9d75b1d78db4b64fe61
parentac31df37588fadb4073cb744fefe62330cadd95a
bgpd: fix import vrf creates multiple bgp instances

The more the vrf green is referenced in the import bgp command, the more
there are instances created. The below configuration shows that the vrf
green is referenced twice, and two BGP instances of vrf green are
created.

The below configuration:
> router bgp 99
> [..]
>  import vrf green
> exit
> router bgp 99 vrf blue
> [..]
>  import vrf green
> exit
> router bgp 99 vrf green
> [..]
> exit
>
> r4# show bgp vrfs
> Type  Id     routerId          #PeersCfg  #PeersEstb  Name
>              L3-VNI            RouterMAC              Interface
> DFLT  0      10.0.3.4          0          0           default
>              0                 00:00:00:00:00:00      unknown
>  VRF  5      10.0.40.4         0          0           blue
>              0                 00:00:00:00:00:00      unknown
>  VRF  6      0.0.0.0           0          0           green
>              0                 00:00:00:00:00:00      unknown
>  VRF  6      10.0.94.4         0          0           green
>              0                 00:00:00:00:00:00      unknown

Fix this at import command, by looking at an already present bgp
instance.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h