diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-12-06 10:28:05 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-12-09 13:37:37 -0500 |
| commit | bd054c1aa288b232fb0bab48af855035df5c62bc (patch) | |
| tree | 6601a43cc5db96056090d149704a16f86cbe3e3a /lib/nexthop.c | |
| parent | df7fb5800b3798057747873c8be245eb13f3ec36 (diff) | |
lib, zebra: Allow for encode/decode of nexthop weight in pass down
Add code to encode/decode the nexthop weight when we pass it down
into zebra.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/nexthop.c')
| -rw-r--r-- | lib/nexthop.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c index 4cb9f68e8a..718cda7355 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -118,6 +118,12 @@ static int _nexthop_cmp_no_labels(const struct 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: |
