diff options
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index fdea766a1b..b7344d7cc1 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1,23 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Zebra API message creation & consumption. * Portions: * Copyright (C) 1997-1999 Kunihiro Ishiguro * Copyright (C) 2015-2018 Cumulus Networks, Inc. * et al. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; see the file COPYING; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -1779,13 +1766,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 +1816,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", |
