diff options
author | Mark Stapp <mjs@voltanet.io> | 2019-11-13 22:06:06 +0100 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2019-12-06 16:17:20 +0100 |
commit | 68a02e06e5f103048d947262c08c569056f74d1c (patch) | |
tree | 2916c9a6284473d8d6b42e69458226ee97943543 /zebra/zapi_msg.c | |
parent | lib: use const in several stream lib apis (diff) | |
download | frr-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 'zebra/zapi_msg.c')
-rw-r--r-- | zebra/zapi_msg.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index bf29bda77..e1654a1a3 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1411,11 +1411,8 @@ static void zread_route_add(ZAPI_HANDLER_ARGS) char buf_prefix[PREFIX_STRLEN]; prefix2str(&api.prefix, buf_prefix, sizeof(buf_prefix)); - zlog_debug("%s: p=%s, ZAPI_MESSAGE_LABEL: %sset, flags=0x%x", - __func__, buf_prefix, - (CHECK_FLAG(api.message, ZAPI_MESSAGE_LABEL) ? "" - : "un"), - api.flags); + zlog_debug("%s: p=%s, flags=0x%x", + __func__, buf_prefix, api.flags); } /* Allocate new route. */ @@ -1544,11 +1541,11 @@ static void zread_route_add(ZAPI_HANDLER_ARGS) return; } - if (api_nh->onlink) + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_ONLINK)) SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK); /* MPLS labels for BGP-LU or Segment Routing */ - if (CHECK_FLAG(api.message, ZAPI_MESSAGE_LABEL) + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL) && api_nh->type != NEXTHOP_TYPE_IFINDEX && api_nh->type != NEXTHOP_TYPE_BLACKHOLE) { enum lsp_types_t label_type; |