From: Roy Marples Date: Tue, 9 Jun 2015 20:00:39 +0000 (+0000) Subject: Set af_waiting if any interface or global is waiting. X-Git-Tag: v6.9.1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a175f2b7dd90b2df00f78fef07d0d145101e2289;p=thirdparty%2Fdhcpcd.git Set af_waiting if any interface or global is waiting. --- diff --git a/README b/README index 17c1c5e6..0b4f88e1 100644 --- 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. diff --git a/dhcpcd-run-hooks.8.in b/dhcpcd-run-hooks.8.in index 3b9e5ab7..e220991e 100644 --- a/dhcpcd-run-hooks.8.in +++ b/dhcpcd-run-hooks.8.in @@ -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 . diff --git a/script.c b/script.c index b45bfa32..4adb261d 100644 --- 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);