]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: use only one IP of neighbor as nexthop
authorChristian Franke <chris@opensourcerouting.org>
Sat, 23 Sep 2017 17:27:29 +0000 (19:27 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Sat, 23 Sep 2017 17:33:00 +0000 (19:33 +0200)
There is no point in building a multipath route via one neighbor
if there is only one link to the neighbor, but the neighbor has
multiple IPs on that link. So only create one nexthop per link.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/isis_route.c

index 267e72002f041f352c63ae0c2990986a9f25b241..ff17572ef9d1c34e7930dc67155da70ef8cf7dfa 100644 (file)
@@ -208,9 +208,6 @@ static void adjinfo2nexthop(struct list *nexthops, struct isis_adjacency *adj)
 {
        struct isis_nexthop *nh;
 
-       if (!adj->ipv4_address_count)
-               return;
-
        for (unsigned int i = 0; i < adj->ipv4_address_count; i++) {
                struct in_addr *ipv4_addr = &adj->ipv4_addresses[i];
                if (!nexthoplookup(nexthops, ipv4_addr,
@@ -219,6 +216,7 @@ static void adjinfo2nexthop(struct list *nexthops, struct isis_adjacency *adj)
                                ipv4_addr, adj->circuit->interface->ifindex);
                        nh->router_address = adj->router_address;
                        listnode_add(nexthops, nh);
+                       return;
                }
        }
 }
@@ -227,9 +225,6 @@ static void adjinfo2nexthop6(struct list *nexthops6, struct isis_adjacency *adj)
 {
        struct isis_nexthop6 *nh6;
 
-       if (!adj->ipv6_address_count)
-               return;
-
        for (unsigned int i = 0; i < adj->ipv6_address_count; i++) {
                struct in6_addr *ipv6_addr = &adj->ipv6_addresses[i];
                if (!nexthop6lookup(nexthops6, ipv6_addr,
@@ -238,6 +233,7 @@ static void adjinfo2nexthop6(struct list *nexthops6, struct isis_adjacency *adj)
                                ipv6_addr, adj->circuit->interface->ifindex);
                        nh6->router_address6 = adj->router_address6;
                        listnode_add(nexthops6, nh6);
+                       return;
                }
        }
 }