]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Remove some old FORKED logic.
authorRoy Marples <roy@marples.name>
Wed, 20 May 2020 20:36:00 +0000 (21:36 +0100)
committerRoy Marples <roy@marples.name>
Wed, 20 May 2020 20:36:00 +0000 (21:36 +0100)
No longer needed now the main process forks from the get go.

src/dhcp.c
src/ipv4.c
src/ipv6.c

index 4b0b26a2d35ae39b5ca86d397be0515616b1836e..3cab1ecf5d4ec8781bfcebed573a37046625e820 100644 (file)
@@ -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);
index a259c87c6e55ec79a7a881ae4ed352885ae4003a..c6a76ea3367d590cac8f149f0f09aa247f59775d 100644 (file)
@@ -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) {
index 025174bcb56cce4b014b28739d66035dd61ee605..c1e23588e059f4a5e18f6f4e461b135e04196697 100644 (file)
@@ -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);