summaryrefslogtreecommitdiffstats
path: root/dhcp.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-29 11:21:16 +0000
committerRoy Marples <roy@marples.name>2009-01-29 11:21:16 +0000
commited913a59775402a9ce66067858d7280fe4506176 (patch)
tree622bc27dd349878a48255b2102e881cedda64401 /dhcp.c
parentf2151f9eafc673071c14667f0f334c3288f74a65 (diff)
downloaddhcpcd-ed913a59775402a9ce66067858d7280fe4506176.tar.xz
dhcpcd should not send hostname by default.
However, the default config file we ship enables the sending of the hostname by default. This makes things more explicit I think, and also allows the FQDN to be sent but not the hostname if someone ever needs this.
Diffstat (limited to 'dhcp.c')
-rw-r--r--dhcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dhcp.c b/dhcp.c
index 264189bb..e53d27c8 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -892,7 +892,7 @@ make_message(struct dhcp_message **message,
* 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]) {
+ if (ifo->options & DHCPCD_HOSTNAME && ifo->hostname[0]) {
*p++ = DHO_HOSTNAME;
hp = strchr(ifo->hostname, '.');
if (hp)
@@ -903,7 +903,7 @@ make_message(struct dhcp_message **message,
memcpy(p, ifo->hostname, len);
p += len;
}
- if (ifo->fqdn != FQDN_DISABLE) {
+ if (ifo->fqdn != FQDN_DISABLE && ifo->hostname[0]) {
/* IETF DHC-FQDN option (81), RFC4702 */
*p++ = DHO_FQDN;
lp = p;