]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Include structure when removing End.DT4/6 SID
authorCarmine Scarpitta <cscarpit@cisco.com>
Sun, 15 Sep 2024 16:56:21 +0000 (18:56 +0200)
committerCarmine Scarpitta <cscarpit@cisco.com>
Mon, 28 Oct 2024 07:14:36 +0000 (08:14 +0100)
Include SID structure information when removing an SRv6 End.DT4 or End.DT6 SID
from the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
bgpd/bgp_mplsvpn.c

index 33883fbca2813e19e0c9b97a148eaad46c1219d5..7f3559bf0fc507f0f111b02481e48c5aee77dbc5 100644 (file)
@@ -418,6 +418,7 @@ void vpn_leak_zebra_vrf_sid_update(struct bgp *bgp, afi_t afi)
 void vpn_leak_zebra_vrf_sid_withdraw(struct bgp *bgp, afi_t afi)
 {
        int debug = BGP_DEBUG(vpn, VPN_LEAK_LABEL);
+       struct seg6local_context seg6localctx = {};
 
        if (bgp->vrf_id == VRF_UNKNOWN) {
                if (debug)
@@ -430,9 +431,16 @@ void vpn_leak_zebra_vrf_sid_withdraw(struct bgp *bgp, afi_t afi)
                zlog_debug("%s: deleting sid for vrf %s afi (id=%d)", __func__,
                           bgp->name_pretty, bgp->vrf_id);
 
-       zclient_send_localsid(zclient,
-               bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent,
-               bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC, NULL);
+       if (bgp->vpn_policy[afi].tovpn_sid_locator) {
+               seg6localctx.block_len =
+                       BGP_PREFIX_SID_SRV6_LOCATOR_BLOCK_LENGTH;
+               seg6localctx.node_len = BGP_PREFIX_SID_SRV6_LOCATOR_NODE_LENGTH;
+               seg6localctx.function_len = BGP_PREFIX_SID_SRV6_FUNCTION_LENGTH;
+               seg6localctx.argument_len = BGP_PREFIX_SID_SRV6_ARGUMENT_LENGTH;
+       }
+       zclient_send_localsid(
+               zclient, bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent,
+               bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC, &seg6localctx);
        XFREE(MTYPE_BGP_SRV6_SID,
              bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent);
 }