# HG changeset patch # User Roy Marples # Date 1590006960 -3600 # Node ID 30906bee600b56d6014aa5d4e4fbc68b70f47691 # Parent 52a4070231c68e3ef732fefc7f18fe041544855a Remove some old FORKED logic. No longer needed now the main process forks from the get go. diff -r 52a4070231c6 -r 30906bee600b src/dhcp.c --- a/src/dhcp.c Wed May 20 18:14:38 2020 +0100 +++ b/src/dhcp.c Wed May 20 21:36:00 2020 +0100 @@ -2010,17 +2010,11 @@ 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_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 @@ 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 @@ !(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 -r 52a4070231c6 -r 30906bee600b src/ipv4.c --- a/src/ipv4.c Wed May 20 18:14:38 2020 +0100 +++ b/src/ipv4.c Wed May 20 21:36:00 2020 +0100 @@ -747,8 +747,6 @@ /* 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 @@ #ifdef ARP arp_announceaddr(ifp->ctx, &state->addr->addr); - if (ifp->ctx->options & DHCPCD_FORKED) - return; #endif if (state->state == DHS_BOUND) { diff -r 52a4070231c6 -r 30906bee600b src/ipv6.c --- a/src/ipv6.c Wed May 20 18:14:38 2020 +0100 +++ b/src/ipv6.c Wed May 20 21:36:00 2020 +0100 @@ -1238,11 +1238,8 @@ } #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 @@ cb, next); cb->callback(cb->arg); free(cb); - if (ctx->options & DHCPCD_FORKED) - goto out; } } } @@ -1274,7 +1269,6 @@ dhcp6_handleifa(cmd, ia, pid); #endif -out: /* Done with the ia now, so free it. */ if (cmd == RTM_DELADDR) ipv6_freeaddr(ia);