dhcpcd-discuss

7.1.0 vs 6.11.5 routes after ipv4ll conflict.

Chuck Forbish

Mon Feb 25 18:59:06 2019

I noticed with the 7.1.0 has an issue with no routes if link local address has a conflict.  Version 6.11.5 does not have the issue.

I noticed a difference in serial output between versions 6.11.5 and 7.1.0.  In version 6.11.5 routes get deleted, then changed.  Whereas in version 7.1.0 they just get changed.  Attached are the console output of both.

I noticed the order of if_route() calls, in 7.1.0, is add then delete.  Because of this we decided to experiment with modifying src/route.c to change this.  With this modification the route issue went away.  Patch file with this change is attached.

I do not know if this is the preferred fix.  Especially since there is a difference between version 6.11.5 and 7.1.0 in logs.

Please advise,


Chuck Forbish
Lexmark International, Inc.
chuck.forbish@xxxxxxxxxxx
859.825.4343
From b5ce90648e175f6836160692ca2829bf4dfe2d14 Mon Sep 17 00:00:00 2001
From: Chuck Forbish <chuck.forbish@xxxxxxxxxxx>
Date: Wed, 20 Feb 2019 14:44:16 -0500
Subject: [PATCH] Remove one HAVE_ROUTE_METRIC section from rt_add().

It claimed:
With route metrics, we can safely add the new route before deleting
the old route.

Tests showed that when a link local address was in conflict and dhcpcd
had to use another, the system did not have any route information.
This leads that the claim is false.
---
 src/route.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/src/route.c b/src/route.c
index e14820f..48648c5 100644
--- a/src/route.c
+++ b/src/route.c
@@ -382,24 +382,6 @@ rt_add(struct rt *nrt, struct rt *ort)
 			logerr("if_route (CHG)");
 	}
 
-#ifdef HAVE_ROUTE_METRIC
-	/* With route metrics, we can safely add the new route before
-	 * deleting the old route. */
-	if (if_route(RTM_ADD, nrt) != -1) {
-		if (ort != NULL) {
-			if (if_route(RTM_DELETE, ort) == -1 && errno != ESRCH)
-				logerr("if_route (DEL)");
-			rt_kfree(ort);
-		}
-		return true;
-	}
-
-	/* If the kernel claims the route exists we need to rip out the
-	 * old one first. */
-	if (errno != EEXIST || ort == NULL)
-		goto logerr;
-#endif
-
 	/* No route metrics, we need to delete the old route before
 	 * adding the new one. */
 #ifdef ROUTE_PER_GATEWAY
-- 
2.7.4

dhcpcd[876]: eth0: probing for an IPv4LL address
dhcpcd[876]: eth0: using IPv4LL address 169.254.30.240
dhcpcd[876]: eth0: adding route to 169.254.0.0/16
dhcpcd[876]: eth0: adding default route
dhcpcd[876]: eth0: no IPv6 Routers available
dhcpcd[876]: eth0: hardware address 52:54:00:12:34:56 claims 169.254.30.240
dhcpcd[876]: eth0: hardware address 52:54:00:12:34:56 claims 169.254.30.240
dhcpcd[876]: eth0: IPv4LL 10 second defence failed for 169.254.30.240/16
dhcpcd[876]: eth0: deleted route to 169.254.0.0/16
dhcpcd[876]: eth0: using IPv4LL address 169.254.178.233
dhcpcd[876]: eth0: adding route to 169.254.0.0/16
dhcpcd[876]: eth0: changing default route
dhcpcd[875]: eth0: probing for an IPv4LL address
dhcpcd[875]: eth0: using IPv4LL address 169.254.67.43
dhcpcd[875]: eth0: adding route to 169.254.0.0/16
dhcpcd[875]: eth0: adding default route
dhcpcd[875]: eth0: no IPv6 Routers available
dhcpcd[875]: eth0: hardware address 52:54:00:12:34:56 claims 169.254.67.43
dhcpcd[875]: eth0: hardware address 52:54:00:12:34:56 claims 169.254.67.43
dhcpcd[875]: eth0: IPv4LL 10 second defence failed for 169.254.67.43/16
dhcpcd[875]: eth0: using IPv4LL address 169.254.164.253
dhcpcd[875]: eth0: changing route to 169.254.0.0/16
dhcpcd[875]: eth0: changing default route

Follow-Ups:
Re: 7.1.0 vs 6.11.5 routes after ipv4ll conflict.Roy Marples
Archive administrator: postmaster@marples.name