]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: Don't roam when anonymous is set
authorRoy Marples <roy@marples.name>
Sun, 27 Dec 2020 21:59:32 +0000 (21:59 +0000)
committerRoy Marples <roy@marples.name>
Sun, 27 Dec 2020 21:59:32 +0000 (21:59 +0000)
We can now remove the NOCARRIER_PRESERVE_IP define.

src/dhcpcd.c
src/if.h

index 42882c2c331bff200005a23c3c2f3b3ea26a4ca1..13480b48637cb1ae532d9ff6c17967bf54dfe8fd 100644 (file)
@@ -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");
index 9a2f262ac3db86d5987d32873df73b37f9a57b6d..43d133075d23532a262affe5175a568d8382cce5 100644 (file)
--- a/src/if.h
+++ b/src/if.h
  * 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.