Mercurial > hg > dhcpcd
changeset 4298:d029c1a28bcc draft
ipv4: add broadcast address to RTM_NEWADDR debug
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Fri, 17 Aug 2018 17:18:56 +0100 |
| parents | 9a20d199768b |
| children | ff2791d0bac1 |
| files | src/ipv4.c |
| diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ipv4.c Wed Jul 25 01:35:52 2018 +0100 +++ b/src/ipv4.c Fri Aug 17 17:18:56 2018 +0100 @@ -816,9 +816,17 @@ bool ia_is_new; #if 0 - logdebugx("%s: %s %s/%d %d", ifname, - cmd == RTM_NEWADDR ? "RTM_NEWADDR" : cmd == RTM_DELADDR ? "RTM_DELADDR" : "???", - inet_ntoa(*addr), inet_ntocidr(*mask), addrflags); + char sbrdbuf[INET_ADDRSTRLEN]; + const char *sbrd; + + if (brd) + sbrd = inet_ntop(AF_INET, brd, sbrdbuf, sizeof(sbrdbuf)); + else + sbrd = NULL; + logdebugx("%s: %s %s/%d %s %d", ifname, + cmd == RTM_NEWADDR ? "RTM_NEWADDR" : + cmd == RTM_DELADDR ? "RTM_DELADDR" : "???", + inet_ntoa(*addr), inet_ntocidr(*mask), sbrd, addrflags); #endif if (ifs == NULL)
