diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-12-11 11:02:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-11 11:02:15 -0500 |
| commit | c81c2303e631a8ccd80229621265baef716ea778 (patch) | |
| tree | 16da85304572827fefadd14b32b6acbf466923df /lib/nexthop.c | |
| parent | 9880c0f3ae2706de0bc07c10133b0c37b14feea5 (diff) | |
| parent | 597371a615b9f062642dfd97b4d81c05e7a9bd55 (diff) | |
Merge pull request #5497 from donaldsharp/unequality_ecmp
Unequality ecmp
Diffstat (limited to 'lib/nexthop.c')
| -rw-r--r-- | lib/nexthop.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/nexthop.c b/lib/nexthop.c index ce8034846f..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: @@ -550,6 +556,7 @@ void nexthop_copy(struct nexthop *copy, const struct nexthop *nexthop, copy->ifindex = nexthop->ifindex; copy->type = nexthop->type; copy->flags = nexthop->flags; + copy->weight = nexthop->weight; memcpy(©->gate, &nexthop->gate, sizeof(nexthop->gate)); memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); |
