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 Import dhcpcd-5.1.3 with the follow...



details:   https://anonhg.NetBSD.org/src/rev/dc41ee6bb492
branches:  trunk
changeset: 748500:dc41ee6bb492
user:      roy <roy%NetBSD.org@localhost>
date:      Sun Oct 25 23:27:30 2009 +0000

description:
Import dhcpcd-5.1.3 with the following changes:
* waitip is enabled when running on a single interface.
* Classless Static Routes are now enabled by default in dhcpcd.conf
  instead of being always being requested.

diffstat:

 external/bsd/dhcpcd/dist/configure.c |  2 +-
 external/bsd/dhcpcd/dist/defs.h      |  2 +-
 external/bsd/dhcpcd/dist/dhcp.c      |  9 ++++++---
 external/bsd/dhcpcd/dist/dhcp.h      |  2 +-
 external/bsd/dhcpcd/dist/dhcpcd.c    |  7 ++++++-
 5 files changed, 15 insertions(+), 7 deletions(-)

diffs (94 lines):

diff -r bcd615137eea -r dc41ee6bb492 external/bsd/dhcpcd/dist/configure.c
--- a/external/bsd/dhcpcd/dist/configure.c      Sun Oct 25 20:53:43 2009 +0000
+++ b/external/bsd/dhcpcd/dist/configure.c      Sun Oct 25 23:27:30 2009 +0000
@@ -547,7 +547,7 @@
                return nrt;
        }
 
-       return get_option_routes(iface->state->new);
+       return get_option_routes(iface->name, iface->state->new);
 }
 
 static struct rt *
diff -r bcd615137eea -r dc41ee6bb492 external/bsd/dhcpcd/dist/defs.h
--- a/external/bsd/dhcpcd/dist/defs.h   Sun Oct 25 20:53:43 2009 +0000
+++ b/external/bsd/dhcpcd/dist/defs.h   Sun Oct 25 23:27:30 2009 +0000
@@ -28,7 +28,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "5.1.2"
+#define VERSION                        "5.1.3"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r bcd615137eea -r dc41ee6bb492 external/bsd/dhcpcd/dist/dhcp.c
--- a/external/bsd/dhcpcd/dist/dhcp.c   Sun Oct 25 20:53:43 2009 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.c   Sun Oct 25 23:27:30 2009 +0000
@@ -71,7 +71,7 @@
                /* RFC 3442 states that the CSR has to come before all other
                 * routes. For completeness, we also specify static routes,
                 * then routers. */
-       { 121,  RFC3442 | REQUEST,      "classless_static_routes" },
+       { 121,  RFC3442,        "classless_static_routes" },
        { 249,  RFC3442,        "ms_classless_static_routes" },
        { 33,   IPV4 | ARRAY | REQUEST, "static_routes" },
        { 3,    IPV4 | ARRAY | REQUEST, "routers" },
@@ -701,7 +701,7 @@
  * If we have a CSR then we only use that.
  * Otherwise we add static routes and then routers. */
 struct rt *
-get_option_routes(const struct dhcp_message *dhcp)
+get_option_routes(const char *ifname, const struct dhcp_message *dhcp)
 {
        const uint8_t *p;
        const uint8_t *e;
@@ -716,8 +716,11 @@
                p = get_option(dhcp, DHO_MSCSR, &len, NULL);
        if (p) {
                routes = decode_rfc3442_rt(len, p);
-               if (routes)
+               if (routes) {
+                       syslog(LOG_DEBUG, "%s: using Classless Static Routes (RFC3442)",
+                              ifname);
                        return routes;
+               }
        }
 
        /* OK, get our static routes first. */
diff -r bcd615137eea -r dc41ee6bb492 external/bsd/dhcpcd/dist/dhcp.h
--- a/external/bsd/dhcpcd/dist/dhcp.h   Sun Oct 25 20:53:43 2009 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.h   Sun Oct 25 23:27:30 2009 +0000
@@ -184,7 +184,7 @@
 #define is_bootp(m) (m &&                                              \
            !IN_LINKLOCAL(htonl((m)->yiaddr)) &&                        \
            get_option_uint8(NULL, m, DHO_MESSAGETYPE) == -1)
-struct rt *get_option_routes(const struct dhcp_message *);
+struct rt *get_option_routes(const char *, const struct dhcp_message *);
 ssize_t configure_env(char **, const char *, const struct dhcp_message *,
     const struct if_options *);
 
diff -r bcd615137eea -r dc41ee6bb492 external/bsd/dhcpcd/dist/dhcpcd.c
--- a/external/bsd/dhcpcd/dist/dhcpcd.c Sun Oct 25 20:53:43 2009 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd.c Sun Oct 25 23:27:30 2009 +0000
@@ -918,7 +918,7 @@
 {
        struct interface *iface = arg;
 
-       syslog(LOG_ERR, "%s: failed to renew, attmepting to rebind",
+       syslog(LOG_ERR, "%s: failed to renew, attempting to rebind",
            iface->name);
        iface->state->state = DHS_REBIND;
        delete_timeout(send_renew, iface);
@@ -1770,6 +1770,11 @@
        ifc = argc - optind;
        ifv = argv + optind;
 
+       /* When running dhcpcd against a single interface, we need to retain
+        * the old behaviour of waiting for an IP address */
+       if (ifc == 1)
+               options |= DHCPCD_WAITIP;
+
        ifaces = discover_interfaces(ifc, ifv);
        for (i = 0; i < ifc; i++) {
                for (iface = ifaces; iface; iface = iface->next)



Home | Main Index | Thread Index | Old Index