changeset 5474:b95f6db91afa draft

dhcpcd: log carrier lost once more
author Roy Marples <roy@marples.name>
date Tue, 22 Sep 2020 13:08:32 +0100
parents 475c5872e821
children 8dcd62252f2d
files src/dhcpcd.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcpcd.c	Mon Sep 21 22:24:18 2020 +0100
+++ b/src/dhcpcd.c	Tue Sep 22 13:08:32 2020 +0100
@@ -727,6 +727,8 @@
 
 	if (carrier == LINK_DOWN || (ifp->flags & IFF_UP) == 0) {
 		if (ifp->carrier != LINK_DOWN) {
+			int oldcarrier = ifp->carrier;
+
 #ifdef NOCARRIER_PRESERVE_IP
 			if (ifp->flags & IFF_UP &&
 			    !(ifp->options->options & DHCPCD_ANONYMOUS))
@@ -736,7 +738,7 @@
 				ifp->carrier = LINK_DOWN;
 			if (!ifp->active)
 				return;
-			if (ifp->carrier == LINK_UP)
+			if (oldcarrier == LINK_UP)
 				loginfox("%s: carrier lost", ifp->name);
 			script_runreason(ifp, "NOCARRIER");
 #ifdef NOCARRIER_PRESERVE_IP