changeset 4929:597274e21b1a draft

inet6: Don't compare router dates when sorting Newest routers are added at the end, so we prefer newest anyway.
author Roy Marples <roy@marples.name>
date Tue, 07 Jan 2020 22:36:56 +0000
parents 3cb7e75517a7
children ab0e8eeeb8ca
files src/ipv6nd.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ipv6nd.c	Tue Jan 07 22:31:17 2020 +0000
+++ b/src/ipv6nd.c	Tue Jan 07 22:36:56 2020 +0000
@@ -618,8 +618,9 @@
 			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;
 		}