diff options
-rw-r--r-- | RELNOTES | 9 | ||||
-rwxr-xr-x | client/scripts/bsdos | 10 | ||||
-rwxr-xr-x | client/scripts/freebsd | 12 | ||||
-rwxr-xr-x | client/scripts/linux | 31 | ||||
-rwxr-xr-x | client/scripts/netbsd | 10 | ||||
-rwxr-xr-x | client/scripts/solaris | 10 |
6 files changed, 61 insertions, 21 deletions
@@ -106,6 +106,15 @@ suggested fixes to <dhcp-users@isc.org>. - Various compilation fixes have been included for the memory related DEBUG #defines in includes/site.h. +- Fixed Linux client script 'unary operator expected' errors with DHCPv6. + +- Fixed setting hostname in Linux hosts that require hostname argument + to be double-quoted. Also allow server-provided hostname to + override hostnames 'localhost' and '(none)'. + +- Added client support for setting interface MTU and metric, thanks to + Roy "UberLord" Marples <roy@marples.name>. + Changes since 4.0.1rc1 - None. diff --git a/client/scripts/bsdos b/client/scripts/bsdos index 12077f0c..ae5ff0c8 100755 --- a/client/scripts/bsdos +++ b/client/scripts/bsdos @@ -72,6 +72,12 @@ fi if [ x$alias_subnet_mask != x ]; then alias_subnet_arg="netmask $alias_subnet_mask" fi +if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" +fi +if [ x$IF_METRIC != x ]; then + metric_arg="metric $IF_METRIC" +fi if [ x$reason = xMEDIUM ]; then eval "ifconfig $interface $medium" @@ -133,7 +139,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" route add $new_ip_address 127.1 >/dev/null 2>&1 for router in $new_routers; do route add default $router >/dev/null 2>&1 @@ -190,7 +196,7 @@ if [ x$reason = xTIMEOUT ]; then route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" sleep 1 if [ "$new_routers" != "" ]; then set $new_routers diff --git a/client/scripts/freebsd b/client/scripts/freebsd index 988c9ef0..dba393f8 100755 --- a/client/scripts/freebsd +++ b/client/scripts/freebsd @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: freebsd,v 1.20 2007/11/30 21:28:29 fdupont Exp $ +# $Id: freebsd,v 1.20.28.1 2009/04/21 14:45:25 pselkirk Exp $ # # $FreeBSD$ @@ -116,6 +116,12 @@ fi if [ x$alias_subnet_mask != x ]; then alias_subnet_arg="netmask $alias_subnet_mask" fi +if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" +fi +if [ x$IF_METRIC != x ]; then + metric_arg="metric $IF_METRIC" +fi if [ x$reason = xMEDIUM ]; then eval "ifconfig $interface $medium" @@ -177,7 +183,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" $LOGGER "New IP Address ($interface): $new_ip_address" $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" @@ -241,7 +247,7 @@ if [ x$reason = xTIMEOUT ]; then route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" $LOGGER "New IP Address ($interface): $new_ip_address" $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" diff --git a/client/scripts/linux b/client/scripts/linux index 6ac25dd4..ecc7c811 100755 --- a/client/scripts/linux +++ b/client/scripts/linux @@ -102,6 +102,12 @@ fi if [ x$alias_subnet_mask != x ]; then alias_subnet_arg="netmask $alias_subnet_mask" fi +if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" +fi +if [ x$IF_METRIC != x ]; then + metric_arg="metric $IF_METRIC" +fi if [ x$reason = xMEDIUM ]; then # Linux doesn't do mediums (ok, ok, media). @@ -137,10 +143,11 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then current_hostname=`hostname` if [ x$current_hostname = x ] || \ + [ x$current_hostname = "x(none)" ] || \ + [ x$current_hostname = xlocalhost ] || \ [ x$current_hostname = x$old_host_name ]; then - if [ x$current_hostname = x ] || \ - [ x$new_host_name != x$old_host_name ]; then - hostname $new_host_name + if [ x$new_host_name != x$old_host_name ]; then + hostname "$new_host_name" fi fi @@ -159,14 +166,14 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then ifconfig $interface inet $new_ip_address $new_subnet_arg \ - $new_broadcast_arg + $new_broadcast_arg $mtu_arg # Add a network route to the computed network address. if [ $relmajor -lt 2 ] || \ ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then route add -net $new_network_number $new_subnet_arg dev $interface fi for router in $new_routers; do - route add default gw $router + route add default gw $router $metric_arg dev $interface done fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; @@ -201,7 +208,7 @@ if [ x$reason = xTIMEOUT ]; then ifconfig $interface:0- inet 0 fi ifconfig $interface inet $new_ip_address $new_subnet_arg \ - $new_broadcast_arg + $new_broadcast_arg $mtu_arg set $new_routers if ping -q -c 1 $1; then if [ x$new_ip_address != x$alias_ip_address ] && \ @@ -214,7 +221,7 @@ if [ x$reason = xTIMEOUT ]; then route add -net $new_network_number fi for router in $new_routers; do - route add default gw $router + route add default gw $router $metric_arg dev $interface done make_resolv_conf exit_with_hooks 0 @@ -227,7 +234,7 @@ fi ### DHCPv6 Handlers ### -if [ ${reason} = PREINIT6 ] ; then +if [ x$reason = xPREINIT6 ] ; then # Ensure interface is up. ${ip} link set ${interface} up @@ -237,7 +244,7 @@ if [ ${reason} = PREINIT6 ] ; then exit_with_hooks 0 fi -if [ ${reason} = BOUND6 ] ; then +if [ x$reason = xBOUND6 ] ; then if [ x${new_ip6_address} = x ] || [ x${new_ip6_prefixlen} = x ] ; then exit_with_hooks 2; fi @@ -251,7 +258,7 @@ if [ ${reason} = BOUND6 ] ; then exit_with_hooks 0 fi -if [ ${reason} = RENEW6 ] || [ ${reason} = REBIND6 ] ; then +if [ x$reason = xRENEW6 ] || [ x$reason = xREBIND6 ] ; then # Make sure nothing has moved around on us. # Nameservers/domains/etc. @@ -263,7 +270,7 @@ if [ ${reason} = RENEW6 ] || [ ${reason} = REBIND6 ] ; then exit_with_hooks 0 fi -if [ ${reason} = DEPREF6 ] ; then +if [ x$reason = xDEPREF6 ] ; then if [ x${new_ip6_prefixlen} = x ] ; then exit_with_hooks 2; fi @@ -276,7 +283,7 @@ if [ ${reason} = DEPREF6 ] ; then exit_with_hooks 0 fi -if [ ${reason} = EXPIRE6 -o ${reason} = RELEASE6 -o ${reason} = STOP6 ] ; then +if [ x$reason = xEXPIRE6 -o x$reason = xRELEASE6 -o x$reason = xSTOP6 ] ; then if [ x${old_ip6_address} = x ] || [ x${old_ip6_prefixlen} = x ] ; then exit_with_hooks 2; fi diff --git a/client/scripts/netbsd b/client/scripts/netbsd index a5394796..40b9fc92 100755 --- a/client/scripts/netbsd +++ b/client/scripts/netbsd @@ -72,6 +72,12 @@ fi if [ x$alias_subnet_mask != x ]; then alias_subnet_arg="netmask $alias_subnet_mask" fi + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi +if [ x$IF_METRIC != x ]; then + metric_arg="metric $IF_METRIC" +fi if [ x$reason = xMEDIUM ]; then eval "ifconfig $interface $medium" @@ -133,7 +139,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" route add $new_ip_address 127.1 >/dev/null 2>&1 for router in $new_routers; do route add default $router >/dev/null 2>&1 @@ -190,7 +196,7 @@ if [ x$reason = xTIMEOUT ]; then route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" sleep 1 if [ "$new_routers" != "" ]; then set $new_routers diff --git a/client/scripts/solaris b/client/scripts/solaris index c2403dc3..4a5452c4 100755 --- a/client/scripts/solaris +++ b/client/scripts/solaris @@ -55,6 +55,12 @@ fi if [ x$alias_subnet_mask != x ]; then alias_subnet_arg="netmask $alias_subnet_mask" fi + if [ x$new_interface_mtu != x ]; then + mtu_arg="mtu $new_interface_mtu" + fi +if [ x$IF_METRIC != x ]; then + metric_arg="metric $IF_METRIC" +fi ifconfig=/sbin/ifconfig @@ -117,7 +123,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" route add $new_ip_address 127.1 1 >/dev/null 2>&1 for router in $new_routers; do route add default $router 1 >/dev/null 2>&1 @@ -158,7 +164,7 @@ if [ x$reason = xTIMEOUT ]; then route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi eval "$ifconfig $interface inet $new_ip_address $new_netmask_arg \ - $new_broadcast_arg $medium" + $new_broadcast_arg $mtu_arg $metric_arg $medium" sleep 1 set $new_routers if ping -s -n -I 1 $1 64 1; then |