]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Set af_waiting if any interface or global is waiting.
authorRoy Marples <roy@marples.name>
Tue, 9 Jun 2015 20:00:39 +0000 (20:00 +0000)
committerRoy Marples <roy@marples.name>
Tue, 9 Jun 2015 20:00:39 +0000 (20:00 +0000)
README
dhcpcd-run-hooks.8.in
script.c

diff --git a/README b/README
index 17c1c5e674e3984e92c6842b27f0a0b936827ef1..0b4f88e1d28d6f84e8f8681008986e35d6ede351 100644 (file)
--- a/README
+++ b/README
@@ -130,7 +130,7 @@ This variable could be used to facilitate service re-entry so this chain could
 happen in a custom OS hook:
   dhcpcd service marked inactive && dhcpcd service starts
   dependant services are not started because dhcpcd is inactive (not stopped)
-  dhcpcd hook tests $if_oneup && $if_ipwaited
+  dhcpcd hook tests if $if_up = true and $af_waiting is empty or unset.
   if true, mark the dhcpcd service as started and then start dependencies
   if false and the dhcpcd service was previously started, mark as inactive and
      stop any dependant services.
index 3b9e5ab7af05e1467dd29189f4eabb416bc1f18c..e220991ef79d93a4af44206fdb269adf7f248891 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 14, 2015
+.Dd June 9, 2015
 .Dt DHCPCD-RUN-HOOKS 8
 .Os
 .Sh NAME
@@ -183,9 +183,9 @@ if the
 .Ev interface
 is down, otherwise
 .Dv false .
-.It Ev $if_oneup
-.Dv true
-if any interface is up, otherwise false.
+.It Ev $af_waiting
+Address family waiting for, as defined in
+.Xr dhcpcd.conf 5 .
 .It Ev $profile
 the name of the profile selected from
 .Xr dhcpcd.conf 5 .
index b45bfa32876d860cb25681a2a8e027478ea3ec14..4adb261d80ad0e624b96f87deb053d34f1cd14f8 100644 (file)
--- a/script.c
+++ b/script.c
@@ -370,6 +370,12 @@ make_env(const struct interface *ifp, const char *reason, char ***argv)
                snprintf(env[elen++], e, "if_afwaiting=%d", af);
        }
        if ((af = dhcpcd_afwaiting(ifp->ctx)) != AF_MAX) {
+               TAILQ_FOREACH(ifp2, ifp->ctx->ifaces, next) {
+                       if ((af = dhcpcd_ifafwaiting(ifp2)) != AF_MAX)
+                               break;
+               }
+       }
+       if (af != AF_MAX) {
                e = 20;
                EMALLOC(elen, e);
                snprintf(env[elen++], e, "af_waiting=%d", af);