diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2025-02-02 13:32:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-02 13:32:36 +0200 |
| commit | 91ebab35f2e88c3eb5664a7266b152ed7bcc283b (patch) | |
| tree | 305b640deaaa35ed9a8e0936f8e0853649b96cab /zebra/zebra_srv6.c | |
| parent | 43a04450e08049c97b0ab398ca183f4ec032b23e (diff) | |
| parent | 339c49bcff61aacdd63e8f2c4f18a3232fb4ca9d (diff) | |
Merge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager
Fix SRv6 SID Manager
Diffstat (limited to 'zebra/zebra_srv6.c')
| -rw-r--r-- | zebra/zebra_srv6.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/zebra/zebra_srv6.c b/zebra/zebra_srv6.c index 624f60e815..6d228c5e24 100644 --- a/zebra/zebra_srv6.c +++ b/zebra/zebra_srv6.c @@ -1547,9 +1547,26 @@ static int get_srv6_sid_explicit(struct zebra_srv6_sid **sid, } if (ctx->behavior == ZEBRA_SEG6_LOCAL_ACTION_END) { - zlog_err("%s: invalid SM request arguments: explicit SID allocation not allowed for End/uN behavior", - __func__); - return -1; + zctx = zebra_srv6_sid_ctx_alloc(); + zctx->ctx = *ctx; + + *sid = zebra_srv6_sid_alloc(zctx, sid_value, locator, block, sid_func, + SRV6_SID_ALLOC_MODE_EXPLICIT); + if (!(*sid)) { + flog_err(EC_ZEBRA_SM_CANNOT_ASSIGN_SID, + "%s: failed to create SRv6 SID %s (%pI6)", __func__, + srv6_sid_ctx2str(buf, sizeof(buf), ctx), sid_value); + return -1; + } + (*sid)->ctx = zctx; + zctx->sid = *sid; + listnode_add(srv6->sids, zctx); + + if (IS_ZEBRA_DEBUG_SRV6) + zlog_debug("%s: allocated explicit SRv6 SID %pI6 for context %s", __func__, + &(*sid)->value, srv6_sid_ctx2str(buf, sizeof(buf), ctx)); + + return 1; } /* Allocate an explicit SID function for the SID */ |
