summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-09-22 13:08:32 +0100
committerRoy Marples <roy@marples.name>2020-09-22 13:08:32 +0100
commit96bf083104435f38e06375fbaa094ab50626b5de (patch)
tree47816799813d15fb95dc21c985daf5767d4a77e9 /src/dhcpcd.c
parent47e72381a26dc5622ac9fa3d8895fd340aa4ea76 (diff)
downloaddhcpcd-96bf083104435f38e06375fbaa094ab50626b5de.tar.xz
dhcpcd: log carrier lost once more
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index d573d3a9..b49cf95c 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -727,6 +727,8 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *ctx, int carrier, unsigned int flags,
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 @@ dhcpcd_handlecarrier(struct dhcpcd_ctx *ctx, int carrier, unsigned int flags,
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