]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
inet6: Don't compare router dates when sorting
authorRoy Marples <roy@marples.name>
Tue, 7 Jan 2020 22:36:56 +0000 (22:36 +0000)
committerRoy Marples <roy@marples.name>
Tue, 7 Jan 2020 22:36:56 +0000 (22:36 +0000)
Newest routers are added at the end, so we prefer newest anyway.

src/ipv6nd.c

index 333bcb420994ae8ba339dfa064cc37d28c65c8fb..f341cea60980998f59fe28dc3a48114d0df963b9 100644 (file)
@@ -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;
                }