summaryrefslogtreecommitdiff
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r--zebra/zapi_msg.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index fdea766a1b..15b5790923 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -1779,13 +1779,19 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p,
nexthop->srte_color = api_nh->srte_color;
}
- /* MPLS labels for BGP-LU or Segment Routing */
+ /* Labels for MPLS BGP-LU or Segment Routing or EVPN */
if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL)
&& api_nh->type != NEXTHOP_TYPE_IFINDEX
&& api_nh->type != NEXTHOP_TYPE_BLACKHOLE
&& api_nh->label_num > 0) {
- label_type = lsp_type_from_re_type(client->proto);
+ /* If label type was passed, use it */
+ if (api_nh->label_type)
+ label_type = api_nh->label_type;
+ else
+ label_type =
+ lsp_type_from_re_type(client->proto);
+
nexthop_add_labels(nexthop, label_type,
api_nh->label_num,
&api_nh->labels[0]);
@@ -1823,7 +1829,7 @@ static bool zapi_read_nexthops(struct zserv *client, struct prefix *p,
mpls_label2str(nexthop->nh_label->num_labels,
nexthop->nh_label->label,
labelbuf, sizeof(labelbuf),
- false);
+ nexthop->nh_label_type, false);
}
zlog_debug("%s: nh=%s, vrf_id=%d %s",