Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/dhcpcd/dist/src Sync
details: https://anonhg.NetBSD.org/src/rev/02550b90d30d
branches: trunk
changeset: 462124:02550b90d30d
user: roy <roy%NetBSD.org@localhost>
date: Thu Jul 25 08:55:18 2019 +0000
description:
Sync
diffstat:
external/bsd/dhcpcd/dist/src/dhcp.c | 19 +++++++++++++------
external/bsd/dhcpcd/dist/src/dhcpcd.c | 14 ++++++++------
2 files changed, 21 insertions(+), 12 deletions(-)
diffs (125 lines):
diff -r 44196d0445e5 -r 02550b90d30d external/bsd/dhcpcd/dist/src/dhcp.c
--- a/external/bsd/dhcpcd/dist/src/dhcp.c Thu Jul 25 08:53:54 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp.c Thu Jul 25 08:55:18 2019 +0000
@@ -127,7 +127,7 @@
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 @@
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 @@
eloop_timeout_add_sec(ifp->ctx->eloop,
DHCP_RAND_MAX, dhcp_discover, ifp);
}
-
-#ifdef ARP
+#endif
+
+#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 @@
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 @@
dhcpcd_startinterface(ifp);
return;
}
+#else
+ UNUSED(amsg);
#endif
addr = astate->addr;
@@ -2304,6 +2309,7 @@
}
#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 @@
#endif
return astate;
}
+#endif
static int
dhcp_arp_address(struct interface *ifp)
diff -r 44196d0445e5 -r 02550b90d30d external/bsd/dhcpcd/dist/src/dhcpcd.c
--- a/external/bsd/dhcpcd/dist/src/dhcpcd.c Thu Jul 25 08:53:54 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcpcd.c Thu Jul 25 08:55:18 2019 +0000
@@ -1210,9 +1210,11 @@
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 @@
}
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 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index