From: Roy Marples Date: Tue, 7 Jan 2020 22:36:56 +0000 (+0000) Subject: inet6: Don't compare router dates when sorting X-Git-Tag: v9.0.0~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f706d872897af4d24a41c8ffc662ff0a0bfaaed6;p=thirdparty%2Fdhcpcd.git inet6: Don't compare router dates when sorting Newest routers are added at the end, so we prefer newest anyway. --- diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 333bcb42..f341cea6 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -618,8 +618,9 @@ ipv6nd_sortrouters(struct dhcpcd_ctx *ctx) if (ipv6nd_rtpref(ra1) < ipv6nd_rtpref(ra2)) continue; /* All things being equal, prefer older routers. */ - if (timespeccmp(&ra1->acquired, &ra2->acquired, >=)) - continue; + /* We don't need to check time, becase newer + * routers are always added to the tail and then + * sorted. */ TAILQ_INSERT_BEFORE(ra2, ra1, next); break; }