diff options
| author | Roy Marples <roy@marples.name> | 2016-02-04 10:43:16 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-02-04 10:43:16 +0000 |
| commit | b699cc3d5ccaf0615bb1d1fe7f569e55196f234a (patch) | |
| tree | 232c719faad414a72f8b53fbdd7eda5daf108d1a /dhcpcd.c | |
| parent | bdf6e269a19da997a0f994d67101be22ec8be2e3 (diff) | |
| download | dhcpcd-b699cc3d5ccaf0615bb1d1fe7f569e55196f234a.tar.xz | |
Introduce IF_INACTIVE, IF_ACTIVE and IF_ACTIVE_USER flags. The intent is that IF_ACTIVE is an interface is active with a system config and IF_ACTIVE_USER with a user config.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -226,7 +226,7 @@ dhcpcd_ifafwaiting(const struct interface *ifp) { unsigned long long opts; - if (!ifp->active) + if (ifp->active != IF_ACTIVE_USER) return AF_MAX; opts = ifp->options->options; @@ -424,7 +424,7 @@ stop_interface(struct interface *ifp) eloop_q_timeout_delete(ctx->eloop, 0, NULL, ifp); /* De-activate the interface */ - ifp->active = 0; + ifp->active = IF_INACTIVE; stop: if (!(ctx->options & (DHCPCD_MASTER | DHCPCD_TEST))) @@ -1003,7 +1003,7 @@ dhcpcd_activateinterface(struct interface *ifp) { if (!ifp->active) { - ifp->active = 1; + ifp->active = IF_ACTIVE; dhcpcd_initstate(ifp, 0); run_preinit(ifp); dhcpcd_prestartinterface(ifp); @@ -1067,7 +1067,7 @@ dhcpcd_handleinterface(void *arg, int action, const char *ifname) if (strcmp(ctx->ifv[i], ifname) == 0) break; if (i >= ctx->ifc) - ifp->active = 0; + ifp->active = IF_INACTIVE; } i = 0; @@ -1184,7 +1184,7 @@ reconf_reboot(struct dhcpcd_ctx *ctx, int action, int argc, char **argv, int oi) else ipv4_applyaddr(ifp); } else if (i != argc) { - ifp->active = 1; + ifp->active = IF_ACTIVE_USER; dhcpcd_initstate1(ifp, argc, argv, 0); run_preinit(ifp); dhcpcd_prestartinterface(ifp); @@ -1908,7 +1908,7 @@ printpidfile: ctx.ifv[i]); } TAILQ_FOREACH(ifp, ctx.ifaces, next) { - if (ifp->active) + if (ifp->active == IF_ACTIVE_USER) break; } if (ifp == NULL) { |
