diff --git a/lib/nexthop.c b/lib/nexthop.c index 98b05295b996..669b7eb1db95 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c @@ -163,6 +163,11 @@ static int _nexthop_cmp_no_labels(const struct nexthop *next1, return 1; } + ret = memcmp(next1->rmac.octet, next2->rmac.octet, ETH_ALEN); + if (0 != ret) { + return ret; + } + switch (next1->type) { case NEXTHOP_TYPE_IPV4: case NEXTHOP_TYPE_IPV6: @@ -440,6 +445,11 @@ bool nexthop_same(const struct nexthop *nh1, const struct nexthop *nh2) if (nexthop_cmp(nh1, nh2) != 0) return false; + if (nh1->resolved && nh2->resolved && nh1->resolved != nh1 && nh1->resolved != nh2 && + nh2->resolved != nh1 && nh2->resolved != nh2) { + return nexthop_same(nh1->resolved, nh2->resolved); + } + return true; }