[klibc] [patch] ipconfig set hostname from dhcpd server

maximilian attems maks at sternwelten.at
Thu Jul 6 18:15:50 PDT 2006

based on a patch by bdb at forbidden.co.uk, see 

Signed-off-by: maximilian attems <maks at sternwelten.at>

diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
index c9d3b0e..3afd7c9 100644
--- a/usr/kinit/ipconfig/main.c
+++ b/usr/kinit/ipconfig/main.c
@@ -87,6 +87,10 @@ static void configure_device(struct netd
 	if (netdev_setdefaultroute(dev))
 		printf("IP-Config: failed to set default route on %s\n",
+	if (dev->hostname[0] &&
+			sethostname(dev->hostname, strlen(dev->hostname)))
+		printf("IP-Config: failed to set hostname '%s' from %s\n",
+			dev->hostname, dev->name);
 static void dump_device_config(struct netdev *dev)


More information about the klibc mailing list