NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/54997: dhcpcd does not set IPv6 default route



Just to note that I have been in touch with Roy Marples, dhcpcd
author, tested the following patch and confirmed that it also works.

diff --git a/src/ipv6nd.c b/src/ipv6nd.c
index 586ad943..dc8ec401 100644
--- a/src/ipv6nd.c
+++ b/src/ipv6nd.c
@@ -595,11 +595,12 @@ ipv6nd_sortrouters(struct dhcpcd_ctx *ctx)
 				continue;
 			if (!ra1->isreachable && ra2->reachable)
 				continue;
-			if (ipv6nd_rtpref(ra1) < ipv6nd_rtpref(ra2))
+			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;
 		}

-- 
Roy Bixler <rcbixler%nyx.net@localhost>
"The fundamental principle of science, the definition almost, is this: the
sole test of the validity of any idea is experiment."
-- Richard P. Feynman



Home | Main Index | Thread Index | Old Index