diff options
| author | Roy Marples <roy@marples.name> | 2020-12-12 17:33:26 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-12-12 17:33:26 +0000 |
| commit | 3249d22e930197d80513ccf8e1876a5b421a1574 (patch) | |
| tree | c68a5fc1538fff37c9b0709edc04e6aefd558135 | |
| parent | 1ce663ad7824953c7edfa315ab8775927cd2df38 (diff) | |
| download | dhcpcd-3249d22e930197d80513ccf8e1876a5b421a1574.tar.xz | |
link: Only report hardware address changes for active interfaces
| -rw-r--r-- | src/dhcpcd.c | 13 |
1 files changed, 9 insertions, 4 deletions
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); |
