]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: VRF-Lite fix default bgp delete
authorDon Slice <dslice@nvidia.com>
Fri, 16 Jul 2021 18:36:10 +0000 (14:36 -0400)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 18 Sep 2024 15:03:10 +0000 (18:03 +0300)
commit4d0e7a49cf8d4311a485281fa50bbff6ee8ca6cc
tree874719ce2686284bf405b6f62815343a433b1684
parent6109043c54b0c0efccc2d5ca8317cb7fb2529fb9
bgpd: VRF-Lite fix default bgp delete

1. bgp coredump is observed when we delete default bgp instance
   when we have multi-vrf; and route-leaking is enabled between
   default, non-default vrfs.
Removing default router bgp when routes leaked between non-default vrfs.
- Routes are leaked from VRF-A to VRF-B
- VPN table is created with auto RD/RT in default instance.
- Default instance is deleted, we try to unimport the routes from all VRFs
- non-default VRF schedules a work-queue to process deleted routes.
- Meanwhile default bgp instance clears VPN tables and free the route
  entries as well, which are still referenced by non-default VRFs which
  have imported routes.
- When work queue process starts to delete imported route in VRF-A it cores
  as it accesses freed memory.

- Whenever we delete bgp in default vrf, we skip deleting routes in the vpn
  table, import and export lists.
- The default hidden bgp instance will not be listed in any of the show
  commands.
- Whenever we create new default instance, handle it with AS number change
  i.e. old hidden default bgp's AS number is updated and also changing
  local_as for all peers.

2. A default instance is created with ASN of the vrf with the import
  statement.
  This may not be the ASN desired for the default table
- First problem with current behavior.
  Define two vrfs with different ASNs and then add import between.
  starting without any bgp config (no default instance)
  A default instance is created with ASN of the vrf with the import
  statement.
  This may not be the ASN desired for the default table
- Second related problem.  Start with a default instance and a vrf in a
  different ASN. Do an import statement in the vrf for a bgp vrf instance
  not yet defined and it auto-creates that bgp/vrf instance and it inherits
  the ASN of the importing vrf
- Handle bgp instances with different ASNs and handle ASN for auto created
  BGP instance

Signed-off-by: Kantesh Mundaragi <kmundaragi@vmware.com>
bgpd/bgp_damp.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h