Module Name:    src
Committed By:   roy
Date:           Thu Jul 25 08:55:18 UTC 2019

Modified Files:
        src/external/bsd/dhcpcd/dist/src: dhcp.c dhcpcd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/dhcpcd/dist/src/dhcpcd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.20 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.21
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.20	Wed Jul 24 09:57:43 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Thu Jul 25 08:55:18 2019
@@ -127,7 +127,7 @@ static const char * const dhcp_params[] 
 
 static int dhcp_openbpf(struct interface *);
 static void dhcp_start1(void *);
-#ifdef ARP
+#if defined(ARP) && (!defined(KERNEL_RFC5227) || defined(ARPING))
 static void dhcp_arp_found(struct arp_state *, const struct arp_msg *);
 #endif
 static void dhcp_handledhcp(struct interface *, struct bootp *, size_t,
@@ -1958,6 +1958,7 @@ dhcp_rebind(void *arg)
 	send_rebind(ifp);
 }
 
+#if defined(ARP) || defined(IN_IFF_DUPLICATED)
 static void
 dhcp_finish_dad(struct interface *ifp, struct in_addr *ia)
 {
@@ -2026,19 +2027,22 @@ dhcp_addr_duplicated(struct interface *i
 	eloop_timeout_add_sec(ifp->ctx->eloop,
 	    DHCP_RAND_MAX, dhcp_discover, ifp);
 }
+#endif
 
-#ifdef ARP
+#if defined(ARP) && (!defined(KERNEL_RFC5227) || defined(ARPING))
 static void
 dhcp_arp_not_found(struct arp_state *astate)
 {
 	struct interface *ifp;
+#ifdef ARPING
 	struct dhcp_state *state;
 	struct if_options *ifo;
+#endif
 
 	ifp = astate->iface;
+#ifdef ARPING
 	state = D_STATE(ifp);
 	ifo = ifp->options;
-#ifdef ARPING
 	if (ifo->arping_len && state->arping_index < ifo->arping_len) {
 		/* We didn't find a profile for this
 		 * address or hwaddr, so move to the next
@@ -2062,12 +2066,11 @@ static void
 dhcp_arp_found(struct arp_state *astate, const struct arp_msg *amsg)
 {
 	struct in_addr addr;
+	struct interface *ifp = astate->iface;
 #ifdef ARPING
-	struct interface *ifp;
 	struct dhcp_state *state;
 	struct if_options *ifo;
 
-	ifp = astate->iface;
 	state = D_STATE(ifp);
 
 	ifo = ifp->options;
@@ -2093,6 +2096,8 @@ dhcp_arp_found(struct arp_state *astate,
 		dhcpcd_startinterface(ifp);
 		return;
 	}
+#else
+	UNUSED(amsg);
 #endif
 
 	addr = astate->addr;
@@ -2304,6 +2309,7 @@ dhcp_arp_defend_failed(struct arp_state 
 }
 #endif
 
+#if !defined(KERNEL_RFC5227) || defined(ARPING)
 static struct arp_state *
 dhcp_arp_new(struct interface *ifp, struct in_addr *addr)
 {
@@ -2322,6 +2328,7 @@ dhcp_arp_new(struct interface *ifp, stru
 #endif
 	return astate;
 }
+#endif
 
 static int
 dhcp_arp_address(struct interface *ifp)

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.21 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.22
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.21	Wed Jul 24 09:57:43 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Thu Jul 25 08:55:18 2019
@@ -1210,9 +1210,11 @@ dhcpcd_handlehwaddr(struct dhcpcd_ctx *c
 static void
 if_reboot(struct interface *ifp, int argc, char **argv)
 {
+#ifdef INET
 	unsigned long long oldopts;
 
 	oldopts = ifp->options->options;
+#endif
 	script_runreason(ifp, "RECONFIGURE");
 	dhcpcd_initstate1(ifp, argc, argv, 0);
 #ifdef INET
@@ -2123,6 +2125,12 @@ exit1:
 		}
 		free(ctx.ifaces);
 	}
+#ifdef HAVE_OPEN_MEMSTREAM
+	if (ctx.script_fp)
+		fclose(ctx.script_fp);
+#endif
+	free(ctx.script_buf);
+	free(ctx.script_env);
 	free_options(&ctx, ifo);
 	rt_dispose(&ctx);
 	free(ctx.duid);
@@ -2146,11 +2154,5 @@ exit1:
 	if (ctx.options & DHCPCD_FORKED)
 		_exit(i); /* so atexit won't remove our pidfile */
 #endif
-#ifdef HAVE_OPEN_MEMSTREAM
-	if (ctx.script_fp)
-		fclose(ctx.script_fp);
-#endif
-	free(ctx.script_buf);
-	free(ctx.script_env);
 	return i;
 }

Reply via email to