--- dhclient-script.O 2009-03-31 16:05:29.000000000 -0700 +++ dhclient-script 2009-06-07 08:06:55.000000000 -0700 @@ -12,6 +12,14 @@ # The alias handling in here probably still sucks. -mdz +num_addr() { + OIFS="$IFS" + IFS="." + set $1 + IFS="$OIFS" + expr $1 \* 16777216 + $2 \* 65536 + $3 \* 256 + $4 +} + make_resolv_conf() { if [ "$new_domain_name" -o "$new_domain_name_servers" ]; then # Find out whether we are going to mount / rw @@ -69,6 +77,20 @@ fi } +update_resolv() { + local args + local uaddr + if [ -n "$new_domain_name_servers" ]; then + for nameserver in $new_domain_name_servers; do + uaddr=`num_addr $nameserver` + args="$args uint32:$uaddr" + done + dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq \ + uk.org.thekelleys.SetServers $args + fi +} + run_hook() { local script="$1" local exit_status @@ -222,7 +244,7 @@ route add -host $alias_ip_address $interface:0 fi - make_resolv_conf + update_resolv ;; @@ -266,7 +288,7 @@ route add default dev $interface gw $router $metric_arg done - make_resolv_conf + update_resolv else # Changed from 'ifconfig $interface inet 0 down' - see Debian bug #144666 ifconfig $interface inet 0