summaryrefslogtreecommitdiff
path: root/staticd/static_zebra.c
diff options
context:
space:
mode:
authorCarmine Scarpitta <cscarpit@cisco.com>2025-02-13 11:01:11 +0100
committerCarmine Scarpitta <cscarpit@cisco.com>2025-02-26 07:19:51 +0100
commitec5ff367b120e67c9e7bd87ffa8baa2334e75628 (patch)
tree5ffc3ba9960fba1c33ffbeb44cc61743c41154b3 /staticd/static_zebra.c
parent646c4f95d9aa978558757df58d013e78f0c50363 (diff)
staticd: Extend `static_zebra_request_srv6_sid` to request SRv6 uA SIDs
In order to configure an SRv6 uA SID in staticd, staticd should request SRv6 SID Manager to allocate a SID bound to the uA behavior. Currently, `static_zebra_request_srv6_sid` does not support requesting SIDs bound to the uA behavior. This commit extends the `static_zebra_request_srv6_sid` function to enable staticd to request SIDs bound to the uA behavior. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Diffstat (limited to 'staticd/static_zebra.c')
-rw-r--r--staticd/static_zebra.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index 552dd3ee1f..d3ff5ee45f 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -890,6 +890,7 @@ extern void static_zebra_request_srv6_sid(struct static_srv6_sid *sid)
struct srv6_sid_ctx ctx = {};
int ret = 0;
struct vrf *vrf;
+ struct interface *ifp;
if (!sid)
return;
@@ -941,12 +942,22 @@ extern void static_zebra_request_srv6_sid(struct static_srv6_sid *sid)
}
break;
+ case SRV6_ENDPOINT_BEHAVIOR_END_X_NEXT_CSID:
+ ctx.behavior = ZEBRA_SEG6_LOCAL_ACTION_END_X;
+ ctx.nh6 = sid->attributes.nh6;
+ ifp = if_lookup_by_name(sid->attributes.ifname, VRF_DEFAULT);
+ if (!ifp) {
+ zlog_warn("Failed to request SRv6 SID %pFX: interface %s does not exist",
+ &sid->addr, sid->attributes.ifname);
+ return;
+ }
+ ctx.ifindex = ifp->ifindex;
+ break;
case SRV6_ENDPOINT_BEHAVIOR_END_PSP_USD:
case SRV6_ENDPOINT_BEHAVIOR_END_NEXT_CSID_PSP_USD:
case SRV6_ENDPOINT_BEHAVIOR_END_X:
case SRV6_ENDPOINT_BEHAVIOR_END_X_PSP:
case SRV6_ENDPOINT_BEHAVIOR_END_X_PSP_USD:
- case SRV6_ENDPOINT_BEHAVIOR_END_X_NEXT_CSID:
case SRV6_ENDPOINT_BEHAVIOR_END_X_NEXT_CSID_PSP:
case SRV6_ENDPOINT_BEHAVIOR_END_X_NEXT_CSID_PSP_USD:
case SRV6_ENDPOINT_BEHAVIOR_OPAQUE:
@@ -1240,6 +1251,9 @@ static int static_zebra_srv6_sid_notify(ZAPI_CALLBACK_ARGS)
return 0;
}
+ if (!IPV6_ADDR_SAME(&ctx.nh6, &in6addr_any))
+ sid->attributes.nh6 = ctx.nh6;
+
SET_FLAG(sid->flags, STATIC_FLAG_SRV6_SID_VALID);
/*