Package: dhcp3-client
Version: 3.1.1-5

If the dhcp server pushes a new host name, then /sbin/dhclient-script
doesn't care. It keeps the old name.
Below is the obvious patch.


Regards

Harri
=================================================================================
--- dhclient-script~    2008-10-17 08:23:26.000000000 +0200
+++ dhclient-script     2008-12-15 15:21:42.000000000 +0100
@@ -99,13 +99,6 @@
     exit $exit_status
 }
 
-set_hostname() {
-    local current_hostname=$(hostname)
-    if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ];
then
-        hostname "$new_host_name"
-    fi
-}
-
 if [ -n "$new_broadcast_address" ]; then
     new_broadcast_arg="broadcast $new_broadcast_address"
 fi
@@ -135,6 +128,8 @@
 run_hook /etc/dhcp3/dhclient-enter-hooks
 run_hookdir /etc/dhcp3/dhclient-enter-hooks.d
 
+test "$new_host_name" && hostname "$new_host_name"
+
 # Execute the operation
 case "$reason" in
     MEDIUM|ARPCHECK|ARPSEND)
@@ -156,8 +151,6 @@
         ;;
     BOUND|RENEW|REBIND|REBOOT)
 
-        set_hostname
-
         if [ -n "$old_ip_address" -a -n "$alias_ip_address" -a \
              "$alias_ip_address" != "$old_ip_address" ]; then
             # Possible new alias. Remove old alias.






-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to