From: Roy Marples Date: Wed, 20 May 2020 20:36:00 +0000 (+0100) Subject: Remove some old FORKED logic. X-Git-Tag: v9.1.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b96af5978a73029b0b645712c102603bbdb38bb;p=thirdparty%2Fdhcpcd.git Remove some old FORKED logic. No longer needed now the main process forks from the get go. --- diff --git a/src/dhcp.c b/src/dhcp.c index 4b0b26a2..3cab1ecf 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -2010,17 +2010,11 @@ dhcp_finish_dad(struct interface *ifp, struct in_addr *ia) state->new_len = state->offer_len; get_lease(ifp, &state->lease, state->new, state->new_len); ipv4_applyaddr(ifp); - if (ifp->ctx->options & DHCPCD_FORKED) - return; state->new = bootp; state->new_len = len; } #endif - /* If we forked, stop here. */ - if (ifp->ctx->options & DHCPCD_FORKED) - return; - #ifdef IPV4LL /* Stop IPv4LL now we have a working DHCP address */ ipv4ll_drop(ifp); @@ -2341,8 +2335,6 @@ dhcp_bind(struct interface *ifp) dhcp_close(ifp); ipv4_applyaddr(ifp); - if (ifp->ctx->options & DHCPCD_FORKED) - return; /* If not in master mode, open an address specific socket. */ if (ctx->options & DHCPCD_MASTER || @@ -2381,9 +2373,6 @@ dhcp_lastlease(void *arg) loginfox("%s: timed out contacting a DHCP server, using last lease", ifp->name); dhcp_bind(ifp); - /* If we forked, stop here. */ - if (ifp->ctx->options & DHCPCD_FORKED) - return; state->interval = 0; dhcp_discover(ifp); } @@ -2682,11 +2671,7 @@ dhcp_reboot(struct interface *ifp) !(ia->addr_flags & IN_IFF_NOTUSEABLE) && #endif dhcp_activeaddr(ifp, &state->lease.addr) == 0) - { arp_ifannounceaddr(ifp, &state->lease.addr); - if (ifp->ctx->options & DHCPCD_FORKED) - return; - } #endif dhcp_new_xid(ifp); diff --git a/src/ipv4.c b/src/ipv4.c index a259c87c..c6a76ea3 100644 --- a/src/ipv4.c +++ b/src/ipv4.c @@ -747,8 +747,6 @@ ipv4_applyaddr(void *arg) /* Announce the preferred address to * kick ARP caches. */ arp_announceaddr(ifp->ctx,&lease->addr); - if (ifp->ctx->options & DHCPCD_FORKED) - return; #endif } script_runreason(ifp, state->reason); @@ -811,8 +809,6 @@ ipv4_applyaddr(void *arg) #ifdef ARP arp_announceaddr(ifp->ctx, &state->addr->addr); - if (ifp->ctx->options & DHCPCD_FORKED) - return; #endif if (state->state == DHS_BOUND) { diff --git a/src/ipv6.c b/src/ipv6.c index 025174bc..c1e23588 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -1238,11 +1238,8 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx, } #endif - if (ia->dadcallback) { + if (ia->dadcallback) ia->dadcallback(ia); - if (ctx->options & DHCPCD_FORKED) - goto out; - } if (IN6_IS_ADDR_LINKLOCAL(&ia->addr) && !(ia->addr_flags & IN6_IFF_NOTUSEABLE)) @@ -1257,8 +1254,6 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx, cb, next); cb->callback(cb->arg); free(cb); - if (ctx->options & DHCPCD_FORKED) - goto out; } } } @@ -1274,7 +1269,6 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx, dhcp6_handleifa(cmd, ia, pid); #endif -out: /* Done with the ia now, so free it. */ if (cmd == RTM_DELADDR) ipv6_freeaddr(ia);