Skip to content

Commit

Permalink
Merge pull request #18157 from FRRouting/mergify/bp/stable/10.0/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
riw777 authored Feb 18, 2025
2 parents c531cf6 + c7047be commit 1c961e2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3891,6 +3891,37 @@ int bgp_delete(struct bgp *bgp)

bgp_vpn_leak_unimport(bgp);

<<<<<<< HEAD
=======
/*
* Release SRv6 SIDs, like it's done in `vpn_leak_postchange()`
* and bgp_sid_vpn_export_cmd/af_sid_vpn_export_cmd commands.
*/
bgp->tovpn_sid_index = 0;
UNSET_FLAG(bgp->vrf_flags, BGP_VRF_TOVPN_SID_AUTO);
delete_vrf_tovpn_sid_per_vrf(bgp_default, bgp);
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
bgp->vpn_policy[afi].tovpn_sid_index = 0;
UNSET_FLAG(bgp->vpn_policy[afi].flags, BGP_VPN_POLICY_TOVPN_SID_AUTO);
delete_vrf_tovpn_sid_per_af(bgp_default, bgp, afi);

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);
}

>>>>>>> d6363625c (bgpd: release manual vpn label on instance deletion)
hook_call(bgp_inst_delete, bgp);

FOREACH_AFI_SAFI (afi, safi)
Expand Down

0 comments on commit 1c961e2

Please sign in to comment.