Subject: sysinst with dhcp: host-name option
To: None <tech-install@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-install
Date: 03/22/2007 15:54:44
Hi,
I've always wondered why sysinst wasn't capable to detect the
installee's host name although it is present in dhcp - today I
discovered the problem:
sysinst is doing
get_dhcp_value(dhcp_host, sizeof(dhcp_host), "hostname");
while dhclient is writing the option as "host-name".
I'm doing a test build with the fix below, and will commit after testing,
unless there are serious objections.
Regards
-is
--- net.c 5 Dec 2006 10:21:09 -0000 1.114
+++ net.c 22 Mar 2007 14:53:48 -0000
@@ -649,7 +649,7 @@
/* pull hostname out of leases file */
dhcp_host[0] = 0;
get_dhcp_value(dhcp_host, sizeof(dhcp_host),
- "hostname");
+ "host-name");
if (dhcp_host[0] != '\0') {
net_dhcpconf |= DHCPCONF_HOST;
strlcpy(net_host, dhcp_host, sizeof net_host);