Mercurial > hg > dhcpcd
changeset 5570:f32e37b1d371 draft
dhcpcd: Don't roam when anonymous is set
We can now remove the NOCARRIER_PRESERVE_IP define.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sun, 27 Dec 2020 21:59:32 +0000 |
| parents | 80fba4edc6c5 |
| children | fb1831c903f6 |
| files | src/dhcpcd.c src/if.h |
| diffstat | 2 files changed, 3 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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.
