# HG changeset patch # User Roy Marples # Date 1607794406 0 # Node ID e27177daaf0a7d2efcd75f477a5cefbc95c9f5c9 # Parent e65d193a1960c446aace60a3ecf1af732c3ca47d link: Only report hardware address changes for active interfaces diff -r e65d193a1960 -r e27177daaf0a src/dhcpcd.c --- a/src/dhcpcd.c Sat Dec 12 13:12:26 2020 +0000 +++ b/src/dhcpcd.c Sat Dec 12 17:33:26 2020 +0000 @@ -1285,8 +1285,9 @@ } 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 @@ (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);