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 bgp_srv6_function *func;
bool is_config);
extern void bgp_vpn_leak_unimport(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 */
bgp_evpn_cleanup(bgp);
bgp_pbr_cleanup(bgp);
- bgp_srv6_cleanup(bgp);
XFREE(MTYPE_BGP_EVPN_INFO, bgp->evpn_info);
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
ecommunity_free(&bgp->vpn_policy[afi].rtlist[dir]);
if (bgp->vpn_policy[afi].tovpn_rd_pretty)
XFREE(MTYPE_BGP, bgp->vpn_policy[afi].tovpn_rd_pretty);
+ 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);
bgp_confederation_id_unset(bgp);
XFREE(MTYPE_BGP, bgp->as_pretty);