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/cbf9075dd907
branches:  trunk
changeset: 788935:cbf9075dd907
user:      roy <roy%NetBSD.org@localhost>
date:      Mon Jul 29 20:39:28 2013 +0000

description:
Sync

diffstat:

 external/bsd/dhcpcd/dist/dhcp.c                |  29 ++++++++---------------
 external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in |   2 +-
 external/bsd/dhcpcd/dist/dhcpcd.8.in           |   2 +-
 external/bsd/dhcpcd/dist/dhcpcd.conf           |  10 +------
 external/bsd/dhcpcd/dist/dhcpcd.conf.5.in      |  32 +++++++++++++++++++++----
 5 files changed, 41 insertions(+), 34 deletions(-)

diffs (176 lines):

diff -r 6196f0e5d156 -r cbf9075dd907 external/bsd/dhcpcd/dist/dhcp.c
--- a/external/bsd/dhcpcd/dist/dhcp.c   Mon Jul 29 20:35:31 2013 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.c   Mon Jul 29 20:39:28 2013 +0000
@@ -1,5 +1,5 @@
 #include <sys/cdefs.h>
- __RCSID("$NetBSD: dhcp.c,v 1.5 2013/06/21 19:40:20 roy Exp $");
+ __RCSID("$NetBSD: dhcp.c,v 1.6 2013/07/29 20:39:28 roy Exp $");
 
 /*
  * dhcpcd - DHCP client daemon
@@ -187,7 +187,7 @@
        { 76,   IPV4A,          "streettalk_directory_assistance_server" },
        { 77,   STRING,         "user_class" },
        { 80,   FLAG | NOREQ,   "rapid_commit" },
-       { 81,   STRING | RFC3397,       "fqdn_name" },
+       { 81,   STRING | RFC3397,       "fqdn" },
        { 85,   IPV4A,          "nds_servers" },
        { 86,   STRING,         "nds_tree_name" },
        { 87,   STRING,         "nds_context" },
@@ -848,7 +848,6 @@
        uint32_t ul;
        uint16_t sz;
        size_t len;
-       const char *hp;
        const struct dhcp_opt *opt;
        const struct if_options *ifo = iface->options;
        const struct dhcp_state *state = D_CSTATE(iface);
@@ -989,25 +988,11 @@
                        }
                }
 
-               /* Regardless of RFC2132, we should always send a hostname
-                * upto the first dot (the short hostname) as otherwise
-                * confuses some DHCP servers when updating DNS.
-                * The FQDN option should be used if a FQDN is required. */
                if (ifo->hostname[0] == '\0')
-                       hostname = get_hostname();
+                       hostname = get_hostname(ifo->options &
+                           DHCPCD_HOSTNAME_SHORT ? 1 : 0);
                else
                        hostname = ifo->hostname;
-               if (ifo->options & DHCPCD_HOSTNAME && hostname) {
-                       *p++ = DHO_HOSTNAME;
-                       hp = strchr(hostname, '.');
-                       if (hp)
-                               len = hp - hostname;
-                       else
-                               len = strlen(hostname);
-                       *p++ = len;
-                       memcpy(p, hostname, len);
-                       p += len;
-               }
                if (ifo->fqdn != FQDN_DISABLE) {
                        /* IETF DHC-FQDN option (81), RFC4702 */
                        *p++ = DHO_FQDN;
@@ -1034,6 +1019,12 @@
                                *lp += ul;
                                p += ul;
                        }
+               } else if (ifo->options & DHCPCD_HOSTNAME && hostname) {
+                       *p++ = DHO_HOSTNAME;
+                       len = strlen(hostname);
+                       *p++ = len;
+                       memcpy(p, hostname, len);
+                       p += len;
                }
 
                /* vendor is already encoded correctly, so just add it */
diff -r 6196f0e5d156 -r cbf9075dd907 external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
--- a/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in    Mon Jul 29 20:35:31 2013 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in    Mon Jul 29 20:39:28 2013 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: dhcpcd-run-hooks.8.in,v 1.4 2013/07/20 21:40:04 wiz Exp $
+.\"     $NetBSD: dhcpcd-run-hooks.8.in,v 1.5 2013/07/29 20:39:28 roy Exp $
 .\" Copyright (c) 2006-2013 Roy Marples
 .\" All rights reserved
 .\"
diff -r 6196f0e5d156 -r cbf9075dd907 external/bsd/dhcpcd/dist/dhcpcd.8.in
--- a/external/bsd/dhcpcd/dist/dhcpcd.8.in      Mon Jul 29 20:35:31 2013 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd.8.in      Mon Jul 29 20:39:28 2013 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: dhcpcd.8.in,v 1.20 2013/07/20 21:40:04 wiz Exp $
+.\"     $NetBSD: dhcpcd.8.in,v 1.21 2013/07/29 20:39:28 roy Exp $
 .\" Copyright (c) 2006-2013 Roy Marples
 .\" All rights reserved
 .\"
diff -r 6196f0e5d156 -r cbf9075dd907 external/bsd/dhcpcd/dist/dhcpcd.conf
--- a/external/bsd/dhcpcd/dist/dhcpcd.conf      Mon Jul 29 20:35:31 2013 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd.conf      Mon Jul 29 20:39:28 2013 +0000
@@ -1,17 +1,11 @@
-# $NetBSD: dhcpcd.conf,v 1.6 2013/06/21 19:40:20 roy Exp $
+# $NetBSD: dhcpcd.conf,v 1.7 2013/07/29 20:39:28 roy Exp $
 
 # A sample configuration for dhcpcd.
 # See dhcpcd.conf(5) for details.
 
-# Inform the DHCPv4 server of our hostname for DDNS.
-# This has been superceded by the FQDN option below, but is included
-# by default for servers which do not understand it.
+# Inform the DHCP server of our hostname for DDNS.
 hostname
 
-# Inform the DHCP server of our hostname for DDNS
-# and/or query for what it should be.
-fqdn
-
 # Use the hardware address of the interface for the Client ID.
 #clientid
 # or
diff -r 6196f0e5d156 -r cbf9075dd907 external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
--- a/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in Mon Jul 29 20:35:31 2013 +0000
+++ b/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in Mon Jul 29 20:39:28 2013 +0000
@@ -1,4 +1,4 @@
-.\"     $NetBSD: dhcpcd.conf.5.in,v 1.2 2013/07/20 21:40:04 wiz Exp $
+.\"     $NetBSD: dhcpcd.conf.5.in,v 1.3 2013/07/29 20:39:28 roy Exp $
 .\" Copyright (c) 2006-2013 Roy Marples
 .\" All rights reserved
 .\"
@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 19, 2013
+.Dd July 25, 2013
 .Dt DHCPCD.CONF 5 SMM
 .Os
 .Sh NAME
@@ -99,6 +99,20 @@
 For example, you can force the hostname hook to always set the hostname with
 .Ic env
 .Va force_hostname=YES .
+.Pp
+If the hostname is set, will be will set to the FQDN if possible as per
+RFC 4702 section 3.1.
+If the FQDN option is missing,
+.Nm dhcpcd
+will still try and set a FQDN from the hostname and domain options for
+consistency.
+To override this, set
+.Ic env
+.Va hostname_fqdn=[YES|NO|SERVER] .
+A value of server means just what the server says, don't manipulate it.
+This could lead to an inconsistent hostname on a DHCPv4 and DHCPv6 network
+where the DHCPv4 hostname is short and the DHCPv6 has an FQDN.
+DHCPv6 has no hostname option.
 .It Ic clientid Ar string
 Send the
 .Ar clientid .
@@ -116,9 +130,9 @@
 .%T "RFC 4361"
 .Re
 compliant clientid.
-This requires persistent storage and not all DHCP servers work with it so it's
-not enabled by default.
-The duid generated will be held in
+If persistent storage is available then a DUID-LLT (link local address + time)
+is generated, otherwise DUID-LL is generated (link local address).
+The DUID-LLT generated will be held in
 .Pa @SYSCONFDIR@/dhcpcd.duid
 and should not be copied to other hosts.
 .It Ic fallback Ar profile
@@ -134,6 +148,14 @@
 If
 .Ar hostname
 is a FQDN (ie, contains a .) then it will be encoded as such.
+.It Ic hostname_short
+Sends the short hostname to the DHCP server instead of the FQDN.
+This is useful because DHCP servers will not register the FQDN in their
+DNS if the domain part does not match theirs.
+.Pp
+Also, see the
+.Ic env
+option above to control how the hostname is set on the host.
 .It Ic ia_na Op Ar iaid
 Request a DHCPv6 Normal Address for
 .Ar iaid .



Home | Main Index | Thread Index | Old Index