]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: allow nexthop lookup on interface only
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 1 Apr 2022 11:27:06 +0000 (13:27 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Mon, 23 May 2022 08:44:50 +0000 (10:44 +0200)
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>
isisd/isis_route.c

index a91ce7eeac2c135828f7047a59df2ddf8c9787ef..0e7947dd46e2f27a7e16d01e86831b308cde4f46 100644 (file)
@@ -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))