From: Roy Marples Date: Mon, 4 Mar 2019 11:42:06 +0000 (+0000) Subject: ipv6nd: Don't sort interfaces when picking best address X-Git-Tag: v8.0.0~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d58ddf06eff6bd3680a3969d3e7a7c88ff99fa4;p=thirdparty%2Fdhcpcd.git ipv6nd: Don't sort interfaces when picking best address --- diff --git a/src/ipv6nd.c b/src/ipv6nd.c index bef77b2a..e148f862 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -403,7 +403,6 @@ ipv6nd_advertise(struct ipv6_addr *ia) return; ctx = ia->iface->ctx; - if_sortinterfaces(ctx); /* Find the most preferred address to advertise. */ iaf = NULL; TAILQ_FOREACH(ifp, ctx->ifaces, next) { @@ -424,7 +423,8 @@ ipv6nd_advertise(struct ipv6_addr *ia) iap->addr_flags & IN6_IFF_NOTUSEABLE) continue; - if (iaf == NULL) + if (iaf == NULL || + iaf->iface->metric > iap->iface->metric) iaf = iap; } }