Skip to content

Commit

Permalink
lib: fix for nexthop lookup of recursive routes
Browse files Browse the repository at this point in the history
For cases where the real nexthop changes for a recursive route, FRR fails to update second level routes depending on this route.

Signed-off-by: Piotr Suchy <psuchy@akamai.com>
  • Loading branch information
piotrsuchy committed Oct 2, 2024
1 parent 237152f commit 4a1d3a0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 4a1d3a0

Please sign in to comment.