diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2022-04-01 13:27:06 +0200 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2022-05-23 10:44:50 +0200 |
commit | a11742dc53e31d1379cb4f7b9b7b750614e30928 (patch) | |
tree | b1fe55d1f374baf192e21025c45c4f40168bfc40 /isisd | |
parent | isisd: remove previous labels before fast-reroute (diff) | |
download | frr-a11742dc53e31d1379cb4f7b9b7b750614e30928.tar.xz frr-a11742dc53e31d1379cb4f7b9b7b750614e30928.zip |
isisd: allow nexthop lookup on interface only
Allow the nexthoplookup function to return the first nexthop found on
ifindex interface if the IP is unspecified.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_route.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/isisd/isis_route.c b/isisd/isis_route.c index a91ce7eea..0e7947dd4 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -91,11 +91,17 @@ static struct isis_nexthop *nexthoplookup(struct list *nexthops, int family, struct isis_nexthop *nh; for (ALL_LIST_ELEMENTS_RO(nexthops, node, nh)) { - if (nh->family != family) - continue; if (nh->ifindex != ifindex) continue; + /* if the IP is unspecified, return the first nexthop found on + * the interface */ + if (!ip) + return nh; + + if (nh->family != family) + continue; + switch (family) { case AF_INET: if (IPV4_ADDR_CMP(&nh->ip.ipv4, &ip->ipv4)) |