diff options
| author | Roy Marples <roy@marples.name> | 2019-01-23 11:43:11 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2019-01-23 11:43:11 +0000 |
| commit | 68135c5d0a130ba301ca2e4552ba3131d92be05f (patch) | |
| tree | e85d5dd6de22777e7d729908bb6d944ecd449113 /src/dhcpcd.c | |
| parent | 9c5d198072450e7019b3947e85d8f90e82f97445 (diff) | |
| download | dhcpcd-68135c5d0a130ba301ca2e4552ba3131d92be05f.tar.xz | |
IP4: Remove #defines for functions when INET is disabled
This allows us to optimise the code better and hopefully
become less error prone.
Diffstat (limited to 'src/dhcpcd.c')
| -rw-r--r-- | src/dhcpcd.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 37ca68f8..b20b2d05 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -210,13 +210,18 @@ dhcpcd_ifafwaiting(const struct interface *ifp) return AF_MAX; opts = ifp->options->options; +#ifdef INET if (opts & DHCPCD_WAITIP4 && !ipv4_hasaddr(ifp)) return AF_INET; +#endif if (opts & DHCPCD_WAITIP6 && !ipv6_hasaddr(ifp)) return AF_INET6; if (opts & DHCPCD_WAITIP && !(opts & (DHCPCD_WAITIP4 | DHCPCD_WAITIP6)) && - !ipv4_hasaddr(ifp) && !ipv6_hasaddr(ifp)) +#ifdef INET + !ipv4_hasaddr(ifp) && +#endif + !ipv6_hasaddr(ifp)) return AF_UNSPEC; return AF_MAX; } @@ -233,9 +238,11 @@ dhcpcd_afwaiting(const struct dhcpcd_ctx *ctx) opts = ctx->options; TAILQ_FOREACH(ifp, ctx->ifaces, next) { +#ifdef INET if (opts & (DHCPCD_WAITIP | DHCPCD_WAITIP4) && ipv4_hasaddr(ifp)) opts &= ~(DHCPCD_WAITIP | DHCPCD_WAITIP4); +#endif if (opts & (DHCPCD_WAITIP | DHCPCD_WAITIP6) && ipv6_hasaddr(ifp)) opts &= ~(DHCPCD_WAITIP | DHCPCD_WAITIP6); @@ -1216,8 +1223,10 @@ reconf_reboot(struct dhcpcd_ctx *ctx, int action, int argc, char **argv, int oi) if (ifp->active == IF_ACTIVE_USER) { if (action) if_reboot(ifp, argc, argv); +#ifdef INET else ipv4_applyaddr(ifp); +#endif } else if (i != argc) { ifp->active = IF_ACTIVE_USER; dhcpcd_initstate1(ifp, argc, argv, 0); |
