Skip to content

Commit

Permalink
Merge pull request #16059 from kacpekwasny/kkwasny/CLIC-139-4
Browse files Browse the repository at this point in the history
bgpd: fixed failing to remove VRF if there is a stale l3vni
  • Loading branch information
ton31337 authored Jun 20, 2024
2 parents 550a3a8 + 171d258 commit 34a6e22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -6983,6 +6983,17 @@ int bgp_evpn_local_l3vni_del(vni_t l3vni, vrf_id_t vrf_id)
return 0;
}

/*
* When bgp instance goes down also clean up what might have been left over
* from evpn.
*/
void bgp_evpn_instance_down(struct bgp *bgp)
{
/* If we have a stale local vni, delete it */
if (bgp->l3vni)
bgp_evpn_local_l3vni_del(bgp->l3vni, bgp->vrf_id);
}

/*
* Handle del of a local VNI.
*/
Expand Down
1 change: 1 addition & 0 deletions bgpd/bgp_evpn.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ extern int bgp_evpn_local_l3vni_add(vni_t vni, vrf_id_t vrf_id,
struct in_addr originator_ip, int filter,
ifindex_t svi_ifindex, bool is_anycast_mac);
extern int bgp_evpn_local_l3vni_del(vni_t vni, vrf_id_t vrf_id);
extern void bgp_evpn_instance_down(struct bgp *bgp);
extern int bgp_evpn_local_vni_del(struct bgp *bgp, vni_t vni);
extern int bgp_evpn_local_vni_add(struct bgp *bgp, vni_t vni,
struct in_addr originator_ip,
Expand Down
3 changes: 3 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3875,6 +3875,9 @@ void bgp_instance_down(struct bgp *bgp)
struct listnode *node;
struct listnode *next;

/* Cleanup evpn instance state */
bgp_evpn_instance_down(bgp);

/* Stop timers. */
if (bgp->t_rmap_def_originate_eval)
EVENT_OFF(bgp->t_rmap_def_originate_eval);
Expand Down

0 comments on commit 34a6e22

Please sign in to comment.