]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: instance delete unimport evpn routes
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 18 Apr 2019 16:11:04 +0000 (09:11 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Thu, 18 Apr 2019 16:13:55 +0000 (09:13 -0700)
commit1b7bb74761cbec1052cd425ec2c4cbdd7f2ee37c
tree42b565152aa58f155a75fa9ed724ddfc6eef3750
parent3c7940063b40250354cccc6b582a81d10a5a4261
bgpd: instance delete unimport evpn routes

EVPN routes (type-2/type-5) are imported from
default bgp instance (where they are learnt) to
non-default vrf instance.

When a bgp instance (default) is deleted,
unimport evpn routes from vrfs.

In absence of unimport, the imported routes in vrf
has parent path info points to default instance's path
info which is no longer valid (if instance is deleted).
When accessing parent path info leads to a crash
in non-default vrf instance.

The bgp instance is not cleaned up when
'no router bgp ASN' is performed, the instance's
reference count remains for evpn imported routes.

Ticket:CM-24484
Reviewed By:

Testing Done:
Validated via learning EVPN type-2/type-5 routes in symmetric
routing scenario.
The routes are imported to VRFs based on corresponding
L3VNI. When the default instance is removed, the evpn routes
are cleaned up from the VRF instance.

TURTLE(config)# do show bgp vrf vrf3 ipv4 unicast

   Network          Next Hop            Metric LocPrf Weight Path
*> 70.1.0.0/16      0.0.0.0                            32768 i
s  70.1.1.24/32     110.0.0.2                              0 65100 65002 i
s>                  110.0.0.2                              0 65100 65002 i
s  70.1.1.43/32     110.0.0.4                              0 65100 65004 i
s>                  110.0.0.4                              0 65100 65004 i

TURTLE(config)# no router bgp 65050
TURTLE(config)# do show bgp vrf vrf3 ipv4 unicast
No BGP prefixes displayed, 0 exist

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
bgpd/bgp_route.c