diff options
| author | Roy Marples <roy@marples.name> | 2020-01-07 22:36:56 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-01-07 22:36:56 +0000 |
| commit | f706d872897af4d24a41c8ffc662ff0a0bfaaed6 (patch) | |
| tree | 04b85cbcec3e3b66fed33b19b2206aab8a106511 /src/ipv6nd.c | |
| parent | 3eb8dfcc0688f38f430e539512c4140e9aa34960 (diff) | |
| download | dhcpcd-f706d872897af4d24a41c8ffc662ff0a0bfaaed6.tar.xz | |
inet6: Don't compare router dates when sorting
Newest routers are added at the end, so we prefer newest anyway.
Diffstat (limited to 'src/ipv6nd.c')
| -rw-r--r-- | src/ipv6nd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |
