From: Roy Marples Date: Sat, 12 Dec 2020 17:33:26 +0000 (+0000) Subject: link: Only report hardware address changes for active interfaces X-Git-Tag: v9.4.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84fda07e2ee113b8567e0809524e74ddad0df2a9;p=thirdparty%2Fdhcpcd.git link: Only report hardware address changes for active interfaces --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 68c82672..e033a827 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -1285,8 +1285,9 @@ dhcpcd_handlehwaddr(struct interface *ifp, } if (ifp->hwtype != hwtype) { - loginfox("%s: hardware address type changed from %d to %d", - ifp->name, ifp->hwtype, hwtype); + if (ifp->active) + loginfox("%s: hardware address type changed" + " from %d to %d", ifp->name, ifp->hwtype, hwtype); ifp->hwtype = hwtype; } @@ -1294,8 +1295,12 @@ dhcpcd_handlehwaddr(struct interface *ifp, (hwlen == 0 || memcmp(ifp->hwaddr, hwaddr, hwlen) == 0)) return; - loginfox("%s: new hardware address: %s", ifp->name, - hwaddr_ntoa(hwaddr, hwlen, buf, sizeof(buf))); + if (ifp->active) { + loginfox("%s: old hardware address: %s", ifp->name, + hwaddr_ntoa(ifp->hwaddr, ifp->hwlen, buf, sizeof(buf))); + loginfox("%s: new hardware address: %s", ifp->name, + hwaddr_ntoa(hwaddr, hwlen, buf, sizeof(buf))); + } ifp->hwlen = hwlen; if (hwaddr != NULL) memcpy(ifp->hwaddr, hwaddr, hwlen);