From: Roy Marples Date: Sun, 28 Jul 2019 14:56:41 +0000 (+0100) Subject: Rework prior again so we log the address in debug. X-Git-Tag: v8.0.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47c6213dee78fda982acb1d6486d10b35f0ae671;p=thirdparty%2Fdhcpcd.git Rework prior again so we log the address in debug. --- diff --git a/src/ipv4.c b/src/ipv4.c index 86e6584b..c3cb0bfb 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -756,14 +756,23 @@ ipv4_applyaddr(void *arg) * If IP addresses do not have lifetimes, there is a very real chance * that re-adding them will scrub the subnet route temporarily * which is a bad thing, so avoid it. */ - if (ia == NULL && - (ia->mask.s_addr != lease->mask.s_addr || - ia->brd.s_addr != lease->brd.s_addr)) + if (ia != NULL && + ia->mask.s_addr == lease->mask.s_addr && + ia->brd.s_addr == lease->brd.s_addr) { +#ifndef IP_LIFETIME + logdebugx("%s: IP address %s already exists", + ifp->name, ia->saddr); +#endif + } else { #ifdef __linux__ + /* Linux does not change netmask/broadcast address + * for re-added addresses, so we need to delete the old one + * first. */ if (ia != NULL) ipv4_deladdr(ia, 0); -#elif !defined(IP_LIFETIME) +#endif +#ifndef IP_LIFETIME if (ipv4_daddaddr(ifp, lease) == -1 && errno != EEXIST) return; #endif