From 74361f41d9bbceedc511d8a086ad274a456d6b49 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Sat, 23 Sep 2017 19:27:29 +0200 Subject: [PATCH] isisd: use only one IP of neighbor as nexthop 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 --- isisd/isis_route.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/isisd/isis_route.c b/isisd/isis_route.c index 267e72002f..ff17572ef9 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -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; } } } -- 2.39.5