summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-05-12 21:03:38 +0000
committerRoy Marples <roy@marples.name>2008-05-12 21:03:38 +0000
commit1b3bc4775a960dbf65ffe3f540d63d122311f9c4 (patch)
treefaca65a7be95961762f4bce6cb02cfabbced9693 /dhcpcd.c
parentda635e38f73a70ea8e1fc51bdd673a78fe34a7b9 (diff)
downloaddhcpcd-1b3bc4775a960dbf65ffe3f540d63d122311f9c4.tar.xz
Don't encode the hostname as a FQDN by default as not all DHCP servers support this.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 209e7a2a..11e4b25c 100644
--- 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)