# HG changeset patch # User Roy Marples # Date 1609106372 0 # Node ID f32e37b1d3715b43cc6b860001ca2bd56b987522 # Parent 80fba4edc6c565667c2d07c633f060cb83eab92d dhcpcd: Don't roam when anonymous is set We can now remove the NOCARRIER_PRESERVE_IP define. diff -r 80fba4edc6c5 -r f32e37b1d371 src/dhcpcd.c --- a/src/dhcpcd.c Sun Dec 27 20:39:38 2020 +0000 +++ b/src/dhcpcd.c Sun Dec 27 21:59:32 2020 +0000 @@ -734,22 +734,13 @@ * Preserve the network state until we either disconnect * or re-connect. */ - if (if_roaming(ifp)) { + if (!(ifp->options->options & DHCPCD_ANONYMOUS) && + if_roaming(ifp)) + { dhcpcd_nocarrier_roaming(ifp); return; } -#ifdef NOCARRIER_PRESERVE_IP - if (ifp->flags & IFF_UP && - !(ifp->options->options & DHCPCD_ANONYMOUS)) - { - /* 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"); dhcpcd_drop(ifp, 0); diff -r 80fba4edc6c5 -r f32e37b1d371 src/if.h --- a/src/if.h Sun Dec 27 20:39:38 2020 +0000 +++ b/src/if.h Sun Dec 27 21:59:32 2020 +0000 @@ -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.