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 Sync



details:   https://anonhg.NetBSD.org/src/rev/d22fd52adb3c
branches:  trunk
changeset: 333080:d22fd52adb3c
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Oct 17 23:42:24 2014 +0000

description:
Sync

diffstat:

 external/bsd/dhcpcd/dist/arp.c                           |   12 +-
 external/bsd/dhcpcd/dist/arp.h                           |    2 +-
 external/bsd/dhcpcd/dist/auth.c                          |    2 +-
 external/bsd/dhcpcd/dist/auth.h                          |    2 +-
 external/bsd/dhcpcd/dist/bpf-filter.h                    |    2 +-
 external/bsd/dhcpcd/dist/common.c                        |    2 +-
 external/bsd/dhcpcd/dist/common.h                        |    2 +-
 external/bsd/dhcpcd/dist/config.h                        |    2 +-
 external/bsd/dhcpcd/dist/control.c                       |    2 +-
 external/bsd/dhcpcd/dist/control.h                       |    2 +-
 external/bsd/dhcpcd/dist/crypt/crypt.h                   |    2 +-
 external/bsd/dhcpcd/dist/crypt/hmac_md5.c                |    2 +-
 external/bsd/dhcpcd/dist/defs.h                          |    4 +-
 external/bsd/dhcpcd/dist/dev.h                           |    2 +-
 external/bsd/dhcpcd/dist/dhcp-common.c                   |    2 +-
 external/bsd/dhcpcd/dist/dhcp-common.h                   |    2 +-
 external/bsd/dhcpcd/dist/dhcp.c                          |   85 +++--
 external/bsd/dhcpcd/dist/dhcp.h                          |    6 +-
 external/bsd/dhcpcd/dist/dhcp6.c                         |  211 ++++++++++----
 external/bsd/dhcpcd/dist/dhcp6.h                         |    7 +-
 external/bsd/dhcpcd/dist/dhcpcd-definitions.conf         |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-embedded.c               |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-embedded.h               |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test            |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump            |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu             |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant  |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone        |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf     |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname        |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf        |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind          |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in           |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in             |    6 +-
 external/bsd/dhcpcd/dist/dhcpcd.8.in                     |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd.c                        |   87 +++--
 external/bsd/dhcpcd/dist/dhcpcd.conf                     |    2 +-
 external/bsd/dhcpcd/dist/dhcpcd.conf.5.in                |   37 +-
 external/bsd/dhcpcd/dist/dhcpcd.h                        |    9 +-
 external/bsd/dhcpcd/dist/duid.c                          |    2 +-
 external/bsd/dhcpcd/dist/duid.h                          |    2 +-
 external/bsd/dhcpcd/dist/eloop.c                         |    2 +-
 external/bsd/dhcpcd/dist/eloop.h                         |    2 +-
 external/bsd/dhcpcd/dist/if-bsd.c                        |   54 ++-
 external/bsd/dhcpcd/dist/if-options.c                    |   44 +-
 external/bsd/dhcpcd/dist/if-options.h                    |    3 +-
 external/bsd/dhcpcd/dist/if.c                            |   19 +-
 external/bsd/dhcpcd/dist/if.h                            |    2 +-
 external/bsd/dhcpcd/dist/ipv4.c                          |  145 ++++++++-
 external/bsd/dhcpcd/dist/ipv4.h                          |    5 +-
 external/bsd/dhcpcd/dist/ipv4ll.c                        |    3 +-
 external/bsd/dhcpcd/dist/ipv4ll.h                        |    2 +-
 external/bsd/dhcpcd/dist/ipv6.c                          |  149 +++++++--
 external/bsd/dhcpcd/dist/ipv6.h                          |   11 +-
 external/bsd/dhcpcd/dist/ipv6nd.c                        |   98 ++++--
 external/bsd/dhcpcd/dist/ipv6nd.h                        |    9 +-
 external/bsd/dhcpcd/dist/script.c                        |    2 +-
 external/bsd/dhcpcd/dist/script.h                        |    2 +-
 59 files changed, 716 insertions(+), 364 deletions(-)

diffs (truncated from 2586 to 300 lines):

diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/arp.c
--- a/external/bsd/dhcpcd/dist/arp.c    Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/arp.c    Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: arp.c,v 1.2 2014/10/06 18:22:29 roy Exp $");
+ __RCSID("$NetBSD: arp.c,v 1.3 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
@@ -42,6 +42,7 @@
 #include <syslog.h>
 #include <unistd.h>
 
+#define ELOOP_QUEUE 2
 #include "config.h"
 #include "arp.h"
 #include "ipv4.h"
@@ -127,6 +128,7 @@
 arp_packet(void *arg)
 {
        struct interface *ifp = arg;
+       const struct interface *ifn;
        uint8_t arp_buffer[ARP_LEN];
        struct arphdr ar;
        uint32_t reply_s;
@@ -173,8 +175,12 @@
                if ((hw_t + ar.ar_hln + ar.ar_pln) - arp_buffer > bytes)
                        continue;
                /* Ignore messages from ourself */
-               if (ar.ar_hln == ifp->hwlen &&
-                   memcmp(hw_s, ifp->hwaddr, ifp->hwlen) == 0)
+               TAILQ_FOREACH(ifn, ifp->ctx->ifaces, next) {
+                       if (ar.ar_hln == ifn->hwlen &&
+                           memcmp(hw_s, ifn->hwaddr, ifn->hwlen) == 0)
+                               break;
+               }
+               if (ifn)
                        continue;
                /* Copy out the IP addresses */
                memcpy(&reply_s, hw_s + ar.ar_hln, ar.ar_pln);
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/arp.h
--- a/external/bsd/dhcpcd/dist/arp.h    Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/arp.h    Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arp.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: arp.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/auth.c
--- a/external/bsd/dhcpcd/dist/auth.c   Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/auth.c   Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: auth.c,v 1.2 2014/10/06 18:22:29 roy Exp $");
+ __RCSID("$NetBSD: auth.c,v 1.3 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/auth.h
--- a/external/bsd/dhcpcd/dist/auth.h   Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/auth.h   Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auth.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: auth.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/bpf-filter.h
--- a/external/bsd/dhcpcd/dist/bpf-filter.h     Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/bpf-filter.h     Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf-filter.h,v 1.5 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: bpf-filter.h,v 1.6 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/common.c
--- a/external/bsd/dhcpcd/dist/common.c Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/common.c Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: common.c,v 1.2 2014/10/06 18:22:29 roy Exp $");
+ __RCSID("$NetBSD: common.c,v 1.3 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/common.h
--- a/external/bsd/dhcpcd/dist/common.h Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/common.h Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: common.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/config.h
--- a/external/bsd/dhcpcd/dist/config.h Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/config.h Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: config.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /* netbsd */
 #define SYSCONFDIR     "/etc"
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/control.c
--- a/external/bsd/dhcpcd/dist/control.c        Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/control.c        Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: control.c,v 1.2 2014/10/06 18:22:29 roy Exp $");
+ __RCSID("$NetBSD: control.c,v 1.3 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/control.h
--- a/external/bsd/dhcpcd/dist/control.h        Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/control.h        Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: control.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: control.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/crypt/crypt.h
--- a/external/bsd/dhcpcd/dist/crypt/crypt.h    Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/crypt/crypt.h    Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crypt.h,v 1.2 2014/10/06 18:22:30 roy Exp $ */
+/* $NetBSD: crypt.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/crypt/hmac_md5.c
--- a/external/bsd/dhcpcd/dist/crypt/hmac_md5.c Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/crypt/hmac_md5.c Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: hmac_md5.c,v 1.2 2014/10/06 18:22:30 roy Exp $");
+ __RCSID("$NetBSD: hmac_md5.c,v 1.3 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/defs.h
--- a/external/bsd/dhcpcd/dist/defs.h   Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/defs.h   Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: defs.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
@@ -30,7 +30,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "6.5.0"
+#define VERSION                        "6.5.1"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/dev.h
--- a/external/bsd/dhcpcd/dist/dev.h    Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dev.h    Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dev.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: dev.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/dhcp-common.c
--- a/external/bsd/dhcpcd/dist/dhcp-common.c    Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp-common.c    Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp-common.c,v 1.2 2014/10/06 18:22:29 roy Exp $");
+ __RCSID("$NetBSD: dhcp-common.c,v 1.3 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/dhcp-common.h
--- a/external/bsd/dhcpcd/dist/dhcp-common.h    Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp-common.h    Fri Oct 17 23:42:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dhcp-common.h,v 1.2 2014/10/06 18:22:29 roy Exp $ */
+/* $NetBSD: dhcp-common.h,v 1.3 2014/10/17 23:42:24 roy Exp $ */
 
 /*
  * dhcpcd - DHCP client daemon
diff -r b0a6e4dcdfb9 -r d22fd52adb3c external/bsd/dhcpcd/dist/dhcp.c
--- a/external/bsd/dhcpcd/dist/dhcp.c   Fri Oct 17 21:48:38 2014 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.c   Fri Oct 17 23:42:24 2014 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp.c,v 1.18 2014/10/06 18:22:29 roy Exp $");
+ __RCSID("$NetBSD: dhcp.c,v 1.19 2014/10/17 23:42:24 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
@@ -1046,7 +1046,7 @@
        return -1;
 }
 
-ssize_t
+static ssize_t
 write_lease(const struct interface *ifp, const struct dhcp_message *dhcp)
 {
        int fd;
@@ -1091,7 +1091,7 @@
        return bytes;
 }
 
-struct dhcp_message *
+static struct dhcp_message *
 read_lease(struct interface *ifp)
 {
        int fd;
@@ -1604,7 +1604,7 @@
        if (dhcp_open(iface) == -1)
                return;
 
-       if (state->addr.s_addr != INADDR_ANY &&
+       if (state->added && state->addr.s_addr != INADDR_ANY &&
            state->new != NULL &&
            (state->new->cookie == htonl(MAGIC_COOKIE) ||
            iface->options->options & DHCPCD_INFORM))
@@ -1843,29 +1843,31 @@
 void
 dhcp_bind(void *arg)
 {
-       struct interface *iface = arg;
-       struct dhcp_state *state = D_STATE(iface);
-       struct if_options *ifo = iface->options;
+       struct interface *ifp = arg;
+       struct dhcp_state *state = D_STATE(ifp);
+       struct if_options *ifo = ifp->options;
        struct dhcp_lease *lease = &state->lease;
        struct timeval tv;
        uint8_t ipv4ll = 0;
 
+       if (state->state == DHS_BOUND)
+               goto applyaddr;
        state->reason = NULL;
        state->xid = 0;
        free(state->old);
        state->old = state->new;
        state->new = state->offer;
        state->offer = NULL;
-       get_lease(iface->ctx, lease, state->new);
+       get_lease(ifp->ctx, lease, state->new);
        if (ifo->options & DHCPCD_STATIC) {
                syslog(LOG_INFO, "%s: using static address %s/%d",
-                   iface->name, inet_ntoa(lease->addr),
+                   ifp->name, inet_ntoa(lease->addr),
                    inet_ntocidr(lease->net));
                lease->leasetime = ~0U;
                state->reason = "STATIC";
        } else if (state->new->cookie != htonl(MAGIC_COOKIE)) {
                syslog(LOG_INFO, "%s: using IPv4LL address %s",
-                   iface->name, inet_ntoa(lease->addr));
+                   ifp->name, inet_ntoa(lease->addr));
                lease->leasetime = ~0U;
                state->reason = "IPV4LL";
                ipv4ll = 1;
@@ -1874,8 +1876,8 @@
                        lease->addr.s_addr = ifo->req_addr.s_addr;
                else
                        lease->addr.s_addr = state->addr.s_addr;
-               syslog(LOG_INFO, "%s: received approval for %s", iface->name,
-                   inet_ntoa(lease->addr));
+               syslog(LOG_INFO, "%s: received approval for %s",
+                   ifp->name, inet_ntoa(lease->addr));
                lease->leasetime = ~0U;
                state->reason = "INFORM";
        } else {
@@ -1888,12 +1890,12 @@
                            lease->rebindtime =
                            lease->leasetime;
                        syslog(LOG_INFO, "%s: leased %s for infinity",
-                           iface->name, inet_ntoa(lease->addr));
+                           ifp->name, inet_ntoa(lease->addr));
                } else {
                        if (lease->leasetime < DHCP_MIN_LEASE) {
                                syslog(LOG_WARNING,
                                    "%s: minimum lease is %d seconds",
-                                   iface->name, DHCP_MIN_LEASE);
+                                   ifp->name, DHCP_MIN_LEASE);
                                lease->leasetime = DHCP_MIN_LEASE;
                        }
                        if (lease->rebindtime == 0)
@@ -1905,7 +1907,7 @@
                                syslog(LOG_WARNING,
                                    "%s: rebind time greater than lease "
                                    "time, forcing to %"PRIu32" seconds",
-                                   iface->name, lease->rebindtime);
+                                   ifp->name, lease->rebindtime);
                        }
                        if (lease->renewaltime == 0)
                                lease->renewaltime =



Home | Main Index | Thread Index | Old Index