]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't encode the hostname as a FQDN by default as not all DHCP servers support this.
authorRoy Marples <roy@marples.name>
Mon, 12 May 2008 21:03:38 +0000 (21:03 +0000)
committerRoy Marples <roy@marples.name>
Mon, 12 May 2008 21:03:38 +0000 (21:03 +0000)
dhcpcd.8.in
dhcpcd.c
dhcpcd.conf.5.in

index c690700e2cb836cef14402c69c1c33fb5aea7c77..2e92370446ab23d1eb0c5d8ce54f69bee85e30c4 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 02, 2008
+.Dd May 12, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
@@ -137,9 +137,7 @@ You can use this option to specify the
 sent, or an empty string to
 stop any
 .Ar hostname
-from being sent. If
-.Ar hostname
-is an FQDN (ie, contains a .) then it will be encoded as such.
+from being sent.
 .It Fl i , -classid Ar classid
 Override the DHCP vendor
 .Ar classid
@@ -245,8 +243,11 @@ Requests that the DHCP server updates DNS using FQDN instead of just a
 hostname. Valid values for
 .Ar fqdn
 are none, ptr and both.
+The current hostname or the hostname specified using the
+.Fl h , -hostname
+option must be a FQDN.
 .Nm
-dhcpcd itself never does any DNS updates.
+itself never does any DNS updates.
 .It Fl I , -clientid Ar clientid
 Change the default clientid sent from the interface hardware address.
 If the string is of the format 01:02:03 then it is encoded as hex.
@@ -288,7 +289,7 @@ Linux Socket Filter, or LPF device on Linux based systems.
 Bourne shell script that is run when we configure or deconfigure an interface.
 .It Pa @SYSCONFDIR@/dhcpcd.duid
 Text file that holds the DUID used to identify the host.
-.It Pa @DBDIR@/dhcpcd- Ns Ar interface Ns .lease
+.It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns .lease
 The actual DHCP message send by the server. We use this when reading the last
 lease and use the files mtime as when it was issued.
 .El
index 209e7a2a92d4a19ce6af46116b431493e3cb544d..11e4b25c7da7cc4ec01adfc7f13c6a51363d5112 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -650,11 +650,17 @@ main(int argc, char **argv)
                        goto abort;
                }
        }
-       if (strchr(options->hostname, '.')) {
+
+       if ((p = strchr(options->hostname, '.'))) {
                if (options->fqdn == FQDN_DISABLE)
-                       options->fqdn = FQDN_BOTH;
-       } else
-               options->fqdn = FQDN_DISABLE;
+                       *p = '\0';
+       } else {
+               if (options->fqdn != FQDN_DISABLE) {
+                       logger(LOG_WARNING, "hostname `%s' is not a FQDN",
+                              options->hostname);
+                       options->fqdn = FQDN_DISABLE;
+               }
+       }
 
        if (options->request_address.s_addr == 0 &&
            options->options & DHCPCD_INFORM)
index e39978c9d12694c1fff885dc7d4bc3dee1b3b4f0..53f8ea1301dcc8da837a93fb567c88ab6b785530 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 02, 2008
+.Dd May 12, 2008
 .Dt DHCPCD.CONF 5 SMM
 .Sh NAME
 .Nm dhcpcd.conf
@@ -67,6 +67,11 @@ if a FQDN (ie, contains a .) then it will be encoded as such.
 .It Ic fqdn Op none | ptr | both
 none disables FQDN encoding, ptr just asks the DHCP server to update the PTR
 record of the host in DNS whereas both also updates the A record.
+The current hostname or the hostname specified using the
+.Fl h , -hostname
+option must be a FQDN.
+.Nm dhcpcd
+itself never does any DNS updates.
 .It Ic interface Ar interface
 Subsequent options are only parsed for this
 .Ar interface .