summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorXiao Liang <shaw.leon@gmail.com>2022-02-22 17:22:45 +0800
committerXiao Liang <shaw.leon@gmail.com>2022-06-10 17:12:48 +0800
commit5609e70fb87a3b23b55629a33e5afb298974c142 (patch)
tree38ec901a91ed7504a7be9154d804dce195888e34 /lib/zclient.c
parentdb6d4c8375f32c11336f9542b558640c5c5915f2 (diff)
lib, zebra, bgpd: Move route EVPN flag to nexthop
Multipath route may have mixed nexthops of EVPN and IP unicast. Move EVPN flag to nexthop to support such cases. Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index a933b6bb2b..e556b768ac 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1038,7 +1038,7 @@ int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
stream_putl(s, api_nh->weight);
/* Router MAC for EVPN routes. */
- if (CHECK_FLAG(api_flags, ZEBRA_FLAG_EVPN_ROUTE))
+ if (CHECK_FLAG(nh_flags, ZAPI_NEXTHOP_FLAG_EVPN))
stream_put(s, &(api_nh->rmac),
sizeof(struct ethaddr));
@@ -1402,7 +1402,7 @@ int zapi_nexthop_decode(struct stream *s, struct zapi_nexthop *api_nh,
STREAM_GETL(s, api_nh->weight);
/* Router MAC for EVPN routes. */
- if (CHECK_FLAG(api_flags, ZEBRA_FLAG_EVPN_ROUTE))
+ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN))
STREAM_GET(&(api_nh->rmac), s,
sizeof(struct ethaddr));
@@ -1830,6 +1830,9 @@ int zapi_nexthop_from_nexthop(struct zapi_nexthop *znh,
if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ONLINK))
SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_ONLINK);
+ if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_EVPN))
+ SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_EVPN);
+
if (nh->nh_label && (nh->nh_label->num_labels > 0)) {
/* Validate */