mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
Merge pull request #13999 from opensourcerouting/fix/backport_cfc5c101602482f987a1e57a579e0686b81b91c9_to_8.5
bgpd: free bgp vpn policy
This commit is contained in:
commit
e1ca52e80a
@ -608,7 +608,7 @@ static void sid_register(struct bgp *bgp, const struct in6_addr *sid,
|
|||||||
listnode_add(bgp->srv6_functions, func);
|
listnode_add(bgp->srv6_functions, func);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sid_unregister(struct bgp *bgp, const struct in6_addr *sid)
|
void sid_unregister(struct bgp *bgp, const struct in6_addr *sid)
|
||||||
{
|
{
|
||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
struct bgp_srv6_function *func;
|
struct bgp_srv6_function *func;
|
||||||
|
@ -336,5 +336,6 @@ extern void vpn_handle_router_id_update(struct bgp *bgp, bool withdraw,
|
|||||||
bool is_config);
|
bool is_config);
|
||||||
extern void bgp_vpn_leak_unimport(struct bgp *from_bgp);
|
extern void bgp_vpn_leak_unimport(struct bgp *from_bgp);
|
||||||
extern void bgp_vpn_leak_export(struct bgp *from_bgp);
|
extern void bgp_vpn_leak_export(struct bgp *from_bgp);
|
||||||
|
extern void sid_unregister(struct bgp *bgp, const struct in6_addr *sid);
|
||||||
|
|
||||||
#endif /* _QUAGGA_BGP_MPLSVPN_H */
|
#endif /* _QUAGGA_BGP_MPLSVPN_H */
|
||||||
|
15
bgpd/bgpd.c
15
bgpd/bgpd.c
@ -3926,7 +3926,6 @@ void bgp_free(struct bgp *bgp)
|
|||||||
|
|
||||||
bgp_evpn_cleanup(bgp);
|
bgp_evpn_cleanup(bgp);
|
||||||
bgp_pbr_cleanup(bgp);
|
bgp_pbr_cleanup(bgp);
|
||||||
bgp_srv6_cleanup(bgp);
|
|
||||||
XFREE(MTYPE_BGP_EVPN_INFO, bgp->evpn_info);
|
XFREE(MTYPE_BGP_EVPN_INFO, bgp->evpn_info);
|
||||||
|
|
||||||
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
|
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
|
||||||
@ -3943,8 +3942,22 @@ void bgp_free(struct bgp *bgp)
|
|||||||
dir = BGP_VPN_POLICY_DIR_TOVPN;
|
dir = BGP_VPN_POLICY_DIR_TOVPN;
|
||||||
if (bgp->vpn_policy[afi].rtlist[dir])
|
if (bgp->vpn_policy[afi].rtlist[dir])
|
||||||
ecommunity_free(&bgp->vpn_policy[afi].rtlist[dir]);
|
ecommunity_free(&bgp->vpn_policy[afi].rtlist[dir]);
|
||||||
|
if (bgp->vpn_policy[afi].tovpn_sid_locator != NULL)
|
||||||
|
srv6_locator_chunk_free(
|
||||||
|
&bgp->vpn_policy[afi].tovpn_sid_locator);
|
||||||
|
if (bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent != NULL)
|
||||||
|
XFREE(MTYPE_BGP_SRV6_SID,
|
||||||
|
bgp->vpn_policy[afi]
|
||||||
|
.tovpn_zebra_vrf_sid_last_sent);
|
||||||
|
if (bgp->vpn_policy[afi].tovpn_sid != NULL) {
|
||||||
|
sid_unregister(bgp, bgp->vpn_policy[afi].tovpn_sid);
|
||||||
|
XFREE(MTYPE_BGP_SRV6_SID,
|
||||||
|
bgp->vpn_policy[afi].tovpn_sid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bgp_srv6_cleanup(bgp);
|
||||||
|
|
||||||
XFREE(MTYPE_BGP, bgp->name);
|
XFREE(MTYPE_BGP, bgp->name);
|
||||||
XFREE(MTYPE_BGP, bgp->name_pretty);
|
XFREE(MTYPE_BGP, bgp->name_pretty);
|
||||||
XFREE(MTYPE_BGP, bgp->snmp_stats);
|
XFREE(MTYPE_BGP, bgp->snmp_stats);
|
||||||
|
Loading…
Reference in New Issue
Block a user