diff options
author | Dmytro Shytyi <dmytro.shytyi@6wind.com> | 2023-07-26 17:56:32 +0200 |
---|---|---|
committer | Dmytro Shytyi <dmytro.shytyi@6wind.com> | 2023-09-20 15:07:15 +0200 |
commit | f20cf1457d43c3d5f61845ea5db1c1743b29cfbf (patch) | |
tree | 933e0cc401c582be7b63878b1daea96b322a89a7 /zebra/zebra_nhg.c | |
parent | doc: srv6 multiple segs SIDs documentation (diff) | |
download | frr-f20cf1457d43c3d5f61845ea5db1c1743b29cfbf.tar.xz frr-f20cf1457d43c3d5f61845ea5db1c1743b29cfbf.zip |
bgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthop
Append zebra and lib to use muliple SRv6 segs SIDs, and keep one
seg SID for bgpd and sharpd.
Note: bgpd and sharpd compilation relies on the lib and zebra files,
i.e if we separate this: lib or zebra or bgpd or sharpd in different
commits - this will not compile.
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Diffstat (limited to 'zebra/zebra_nhg.c')
-rw-r--r-- | zebra/zebra_nhg.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 3a56bf2a5..9588f65fc 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1868,11 +1868,18 @@ static struct nexthop *nexthop_set_resolved(afi_t afi, labels); if (nexthop->nh_srv6) { - nexthop_add_srv6_seg6local(resolved_hop, - nexthop->nh_srv6->seg6local_action, - &nexthop->nh_srv6->seg6local_ctx); - nexthop_add_srv6_seg6(resolved_hop, - &nexthop->nh_srv6->seg6_segs); + if (nexthop->nh_srv6->seg6local_action != + ZEBRA_SEG6_LOCAL_ACTION_UNSPEC) + nexthop_add_srv6_seg6local(resolved_hop, + nexthop->nh_srv6 + ->seg6local_action, + &nexthop->nh_srv6 + ->seg6local_ctx); + if (nexthop->nh_srv6->seg6_segs) + nexthop_add_srv6_seg6(resolved_hop, + &nexthop->nh_srv6->seg6_segs->seg[0], + nexthop->nh_srv6->seg6_segs + ->num_segs); } resolved_hop->rparent = nexthop; |