summaryrefslogtreecommitdiff
path: root/staticd
diff options
context:
space:
mode:
authorDmytro Shytyi <dmytro.shytyi@6wind.com>2023-07-26 18:00:17 +0200
committerDmytro Shytyi <dmytro.shytyi@6wind.com>2023-09-20 15:07:15 +0200
commit35028f833c40f8481e94e0a7890b60ad232fade9 (patch)
treef7f344b1f082ad0e4af5e2ec5467ff32be4708b2 /staticd
parent21eb1449c71434bbdb11c7e112aa92d4a2bc1f53 (diff)
staticd: zebra, modify nexthop to support multiple srv6 segs SIDs
Adapt the nexthop from 1 to multiple srv6 seg SIDs Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_zebra.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index 4f3ccde53d..6abbdadc08 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -499,6 +499,21 @@ extern void static_zebra_route_add(struct static_path *pn, bool install)
for (i = 0; i < api_nh->label_num; i++)
api_nh->labels[i] = nh->snh_label.label[i];
}
+ if (nh->snh_seg.num_segs) {
+ int i;
+
+ api_nh->seg6local_action =
+ ZEBRA_SEG6_LOCAL_ACTION_UNSPEC;
+ SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6);
+ SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION);
+ api.safi = SAFI_UNICAST;
+
+ api_nh->seg_num = nh->snh_seg.num_segs;
+ for (i = 0; i < api_nh->seg_num; i++)
+ memcpy(&api_nh->seg6_segs[i],
+ &nh->snh_seg.seg[i],
+ sizeof(struct in6_addr));
+ }
nh_num++;
}