]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: Only poll after mac randomisation
authorRoy Marples <roy@marples.name>
Fri, 19 Jun 2020 08:36:55 +0000 (09:36 +0100)
committerRoy Marples <roy@marples.name>
Fri, 19 Jun 2020 08:36:55 +0000 (09:36 +0100)
That will cause a delay and poll instantly rather than
an initial wait.

src/dhcpcd.c

index c7176d9350190e7238d65732b38652435d72d435..4907523ec78186c8293a9f2adaf3abb553a62b8f 100644 (file)
@@ -878,7 +878,8 @@ dhcpcd_startinterface(void *arg)
                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 @@ dhcpcd_prestartinterface(void *arg)
        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 @@ dhcpcd_prestartinterface(void *arg)
                        logerr(__func__);
        }
 
+       if (ifp->options->poll != 0)
+               if_pollinit(ifp);
+
        dhcpcd_startinterface(ifp);
 }