From: Roy Marples Date: Sun, 27 Dec 2020 21:59:32 +0000 (+0000) Subject: dhcpcd: Don't roam when anonymous is set X-Git-Tag: v9.4.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb5de1714ecfb21d63936c22bc4602c8827d2e7c;p=thirdparty%2Fdhcpcd.git dhcpcd: Don't roam when anonymous is set We can now remove the NOCARRIER_PRESERVE_IP define. --- diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 42882c2c..13480b48 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -734,21 +734,12 @@ dhcpcd_handlecarrier(struct interface *ifp, int carrier, unsigned int flags) * Preserve the network state until we either disconnect * or re-connect. */ - if (if_roaming(ifp)) { - dhcpcd_nocarrier_roaming(ifp); - return; - } - -#ifdef NOCARRIER_PRESERVE_IP - if (ifp->flags & IFF_UP && - !(ifp->options->options & DHCPCD_ANONYMOUS)) + if (!(ifp->options->options & DHCPCD_ANONYMOUS) && + if_roaming(ifp)) { - /* This OS supports the roaming concept on any - * interface. */ dhcpcd_nocarrier_roaming(ifp); return; } -#endif loginfox("%s: carrier lost", ifp->name); script_runreason(ifp, "NOCARRIER"); diff --git a/src/if.h b/src/if.h index 9a2f262a..43d13307 100644 --- a/src/if.h +++ b/src/if.h @@ -42,14 +42,6 @@ * dhcpcd can poll it for the relevant flags periodically */ #define IF_POLL_UP 100 /* milliseconds */ -/* Some systems have in-built IPv4 DAD. - * However, we need them to do DAD at carrier up as well. */ -#ifdef IN_IFF_TENTATIVE -# ifdef __NetBSD__ -# define NOCARRIER_PRESERVE_IP -# endif -#endif - /* * Systems which handle 1 address per alias. * Currenly this is just Solaris.