summaryrefslogtreecommitdiff
path: root/lib/zclient.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-12-11 11:02:15 -0500
committerGitHub <noreply@github.com>2019-12-11 11:02:15 -0500
commitc81c2303e631a8ccd80229621265baef716ea778 (patch)
tree16da85304572827fefadd14b32b6acbf466923df /lib/zclient.c
parent9880c0f3ae2706de0bc07c10133b0c37b14feea5 (diff)
parent597371a615b9f062642dfd97b4d81c05e7a9bd55 (diff)
Merge pull request #5497 from donaldsharp/unequality_ecmp
Unequality ecmp
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 5ce1150b05..6982d287a2 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -802,6 +802,12 @@ static int zapi_nexthop_cmp_no_labels(const struct zapi_nexthop *next1,
if (next1->type > next2->type)
return 1;
+ if (next1->weight < next2->weight)
+ return -1;
+
+ if (next1->weight > next2->weight)
+ return 1;
+
switch (next1->type) {
case NEXTHOP_TYPE_IPV4:
case NEXTHOP_TYPE_IPV6:
@@ -882,6 +888,9 @@ int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
}
}
+ if (api_nh->weight)
+ SET_FLAG(nh_flags, ZAPI_NEXTHOP_FLAG_WEIGHT);
+
/* Note that we're only encoding a single octet */
stream_putc(s, nh_flags);
@@ -920,6 +929,9 @@ int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh,
api_nh->label_num * sizeof(mpls_label_t));
}
+ if (api_nh->weight)
+ stream_putl(s, api_nh->weight);
+
/* Router MAC for EVPN routes. */
if (CHECK_FLAG(api_flags, ZEBRA_FLAG_EVPN_ROUTE))
stream_put(s, &(api_nh->rmac),
@@ -1082,6 +1094,9 @@ static int zapi_nexthop_decode(struct stream *s, struct zapi_nexthop *api_nh,
api_nh->label_num * sizeof(mpls_label_t));
}
+ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_WEIGHT))
+ STREAM_GETL(s, api_nh->weight);
+
/* Router MAC for EVPN routes. */
if (CHECK_FLAG(api_flags, ZEBRA_FLAG_EVPN_ROUTE))
STREAM_GET(&(api_nh->rmac), s,