]> git.puffer.fish Git - mirror/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>
Tue, 4 Feb 2025 09:32:04 +0000 (11:32 +0200)
commit8c187fb4f838d8d8a21f8608c3a510136764b122
treec65f13588ac28e4c31ceba90feaeb9274e2f3a41
parentaba588dd09aa098a88ba1355798c0e784e91ebc8
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