Skip to content

Commit

Permalink
Merge pull request #18154 from FRRouting/mergify/bp/dev/10.3/pr-18121
Browse files Browse the repository at this point in the history
bgpd: release manual vpn label on instance deletion (backport #18121)
  • Loading branch information
donaldsharp authored Feb 13, 2025
2 parents dcebe85 + 6a72fac commit 961a952
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4063,9 +4063,19 @@ int bgp_delete(struct bgp *bgp)
vpn_leak_zebra_vrf_sid_withdraw(bgp, afi);
}

/* release auto vpn labels */
bgp_vpn_release_label(bgp, AFI_IP, true);
bgp_vpn_release_label(bgp, AFI_IP6, true);

/* release manual vpn labels */
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
if (!CHECK_FLAG(bgp->vpn_policy[afi].flags, BGP_VPN_POLICY_TOVPN_LABEL_MANUAL_REG))
continue;
bgp_zebra_release_label_range(bgp->vpn_policy[afi].tovpn_label,
bgp->vpn_policy[afi].tovpn_label);
UNSET_FLAG(bgp->vpn_policy[afi].flags, BGP_VPN_POLICY_TOVPN_LABEL_MANUAL_REG);
}

hook_call(bgp_inst_delete, bgp);

FOREACH_AFI_SAFI (afi, safi)
Expand Down

0 comments on commit 961a952

Please sign in to comment.