changeset 5377:31ce574fac88 draft

dhcpcd: Only poll after mac randomisation That will cause a delay and poll instantly rather than an initial wait.
author Roy Marples <roy@marples.name>
date Fri, 19 Jun 2020 09:36:55 +0100
parents 66bbeeebbe92
children ab1aeca76c73
files src/dhcpcd.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcpcd.c	Thu Jun 18 21:15:15 2020 +0100
+++ b/src/dhcpcd.c	Fri Jun 19 09:36:55 2020 +0100
@@ -878,7 +878,8 @@
 		case LINK_UNKNOWN:
 			/* No media state available.
 			 * Loop until both IFF_UP and IFF_RUNNING are set */
-			if_pollinit(ifp);
+			if (ifo->poll == 0)
+				if_pollinit(ifp);
 			return;
 		}
 	}
@@ -969,9 +970,6 @@
 	struct dhcpcd_ctx *ctx = ifp->ctx;
 	bool anondown;
 
-	if (ifp->options->poll != 0)
-		if_pollinit(ifp);
-
 	if (ifp->carrier == LINK_DOWN &&
 	    ifp->options->options & DHCPCD_ANONYMOUS &&
 	    ifp->flags & IFF_UP)
@@ -992,6 +990,9 @@
 			logerr(__func__);
 	}
 
+	if (ifp->options->poll != 0)
+		if_pollinit(ifp);
+
 	dhcpcd_startinterface(ifp);
 }