summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2024-09-15 18:56:21 +0200
committerCarmine Scarpitta <cscarpit@cisco.com>2024-10-28 08:14:36 +0100
commit38653edbf53ef91e4c0c81bdcd075aa4ed1e0493 (patch)
treed104c4e327dc31413f89621ec4da0766a4e02217
parent89efcb29b1da7d821b389c5631f831c0df749acd (diff)
bgpd: Include structure when removing End.DT4/6 SID
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>
-rw-r--r--bgpd/bgp_mplsvpn.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 33883fbca2..7f3559bf0f 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -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);
}