summaryrefslogtreecommitdiffstats
path: root/staticd
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-11-13 22:06:06 +0100
committerMark Stapp <mjs@voltanet.io>2019-12-06 16:17:20 +0100
commit68a02e06e5f103048d947262c08c569056f74d1c (patch)
tree2916c9a6284473d8d6b42e69458226ee97943543 /staticd
parentlib: use const in several stream lib apis (diff)
downloadfrr-68a02e06e5f103048d947262c08c569056f74d1c.tar.xz
frr-68a02e06e5f103048d947262c08c569056f74d1c.zip
*: revise zapi nexthop encoding
Use a per-nexthop flag to indicate the presence of labels; add some utility zapi encode/decode apis for nexthops; use the zapi apis more consistently. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_zebra.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index a474613b4..42646d15b 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -388,7 +388,8 @@ extern void static_zebra_route_add(struct route_node *rn,
continue;
api_nh->vrf_id = si->nh_vrf_id;
- api_nh->onlink = si->onlink;
+ if (si->onlink)
+ SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_ONLINK);
si->state = STATIC_SENT_TO_ZEBRA;
@@ -441,7 +442,7 @@ extern void static_zebra_route_add(struct route_node *rn,
if (si->snh_label.num_labels) {
int i;
- SET_FLAG(api.message, ZAPI_MESSAGE_LABEL);
+ SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL);
api_nh->label_num = si->snh_label.num_labels;
for (i = 0; i < api_nh->label_num; i++)
api_nh->labels[i] = si->snh_label.label[i];