summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-12-27 21:59:32 +0000
committerRoy Marples <roy@marples.name>2020-12-27 21:59:32 +0000
commitc8db8091092d4db3f815bd4573ffdb5085dc2b8b (patch)
treee4d4cdf3c7cb3aa88919306640718ab95e3b9844
parent8e3bd39b247a9b8ecef37ec0bd455318a4e43e7a (diff)
downloaddhcpcd-c8db8091092d4db3f815bd4573ffdb5085dc2b8b.tar.xz
dhcpcd: Don't roam when anonymous is set
We can now remove the NOCARRIER_PRESERVE_IP define.
-rw-r--r--src/dhcpcd.c13
-rw-r--r--src/if.h8
2 files changed, 2 insertions, 19 deletions
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.