Commit 130c0f47fdf9c533deb1136cad5136f6cb7020f0

Authored by Wu Fengguang
Committed by David S. Miller
1 parent 614f60fa9d

ipconfig: send host-name in DHCP requests

Normally dhclient can be configured to send the "host-name" option
in DHCP requests to update the client's DNS record. However for an
NFSROOT system, dhclient shall never be called (which may change the
IP addr and therefore lose your root NFS mount connection).

So enable updating the DNS record with kernel parameter

	ip=::::$HOST_NAME::dhcp

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 7 additions and 0 deletions Side-by-side Diff

... ... @@ -665,6 +665,13 @@
665 665 memcpy(e, ic_req_params, sizeof(ic_req_params));
666 666 e += sizeof(ic_req_params);
667 667  
  668 + if (ic_host_name_set) {
  669 + *e++ = 12; /* host-name */
  670 + len = strlen(utsname()->nodename);
  671 + *e++ = len;
  672 + memcpy(e, utsname()->nodename, len);
  673 + e += len;
  674 + }
668 675 if (*vendor_class_identifier) {
669 676 printk(KERN_INFO "DHCP: sending class identifier \"%s\"\n",
670 677 vendor_class_identifier);