]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
pull up from rt18597 to HEAD
authorPaul Selkirk <pselkirk@isc.org>
Tue, 21 Apr 2009 14:09:57 +0000 (14:09 +0000)
committerPaul Selkirk <pselkirk@isc.org>
Tue, 21 Apr 2009 14:09:57 +0000 (14:09 +0000)
RELNOTES
client/scripts/bsdos
client/scripts/freebsd
client/scripts/linux
client/scripts/netbsd
client/scripts/openwrt
client/scripts/solaris

index 5760b126b6c983fd88f0b45d17869059f8324c60..60b96b36156d2ad93076d88a6310568bf7235894 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -46,6 +46,9 @@ work on other platforms. Please report any problems and suggested fixes to
   rather than using a broadcast address.  Thanks to a patch from David
   Cantrell at Red Hat.
 
+- Added client support for setting interface MTU and metric, thanks to
+  Roy "UberLord" Marples <roy@marples.name>.
+
                        Changes since 4.1.0 (bug fixes)
 
 - Validate the argument to the -p option.
@@ -106,6 +109,12 @@ work on other platforms. Please report any problems and suggested fixes to
 - 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)'.
+
                        Changes since 4.1.0b1
 
 - A missing "else" in dhcrelay.c could have caused an interface not to
index 7f858502d784ac628a1b8e75b6c6059e2b59d8fa..e226f8026afb7ec03710a07726f52a4848153ba6 100755 (executable)
@@ -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
index ea8f5bb5e7adc5793289303f093d1ddb06d43223..ac215ee4f6a05adec80896d021364f6e2c51275a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $Id: freebsd,v 1.22 2008/05/23 13:56:07 fdupont Exp $
+# $Id: freebsd,v 1.23 2009/04/21 14:09:57 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"
@@ -247,7 +253,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"
index 49f0977df6538b20ee7745cd95ee88f24c8d0efc..4b3f1670c7dd48321cc762083fc112233d9874b5 100755 (executable)
@@ -78,11 +78,6 @@ if [ -f /etc/dhclient-enter-hooks ]; then
   fi
 fi
 
-release=`uname -r`
-release=`expr $release : '\(.*\)\..*'`
-relminor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
-relmajor=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
-
 ###
 ### DHCPv4 Handlers
 ###
@@ -102,6 +97,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).
@@ -113,15 +114,7 @@ if [ x$reason = xPREINIT ]; then
     # Bring down alias interface. Its routes will disappear too.
     ifconfig $interface:0- inet 0
   fi
-  if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
-   then
-    ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
-               broadcast 255.255.255.255 up
-    # Add route to make broadcast work. Do not omit netmask.
-    route add default dev $interface netmask 0.0.0.0
-  else
-    ifconfig $interface 0 up
-  fi
+  ifconfig $interface 0 up
 
   # We need to give the kernel some time to get the interface up.
   sleep 1
@@ -137,10 +130,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,17 +153,13 @@ 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
       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
        route add -host $router dev $interface
       fi
-      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 ];
@@ -204,7 +194,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 ] && \
@@ -212,15 +202,11 @@ if [ x$reason = xTIMEOUT ]; then
       ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
       route add -host $alias_ip_address dev $interface:0
     fi
-    if [ $relmajor -lt 2 ] || \
-               ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
-      route add -net $new_network_number
-    fi
     for router in $new_routers; do
       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
        route add -host $router dev $interface
       fi
-      route add default gw $router
+      route add default gw $router $metric_arg dev $interface
     done
     make_resolv_conf
     exit_with_hooks 0
@@ -233,7 +219,7 @@ fi
 ### DHCPv6 Handlers
 ###
 
-if [ ${reason} = PREINIT6 ] ; then
+if [ x$reason = xPREINIT6 ] ; then
   # Ensure interface is up.
   ${ip} link set ${interface} up
 
@@ -249,7 +235,7 @@ if [ x${old_ip6_prefix} != x ] || [ x${new_ip6_prefix} != x ] ; 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
@@ -263,7 +249,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.
@@ -275,7 +261,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
@@ -286,7 +272,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
index 7a26d28d7bda960df0525f9dbcbaae9e5189777c..7cbb64c0355b1a8dbc4569b84db34e5dc70de5f4 100755 (executable)
@@ -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
index f2658c76ed36e8e3a370e571cd421c1bc2d3eaa3..e1775ffa49bcd7e2be7019a08608b568110c7365 100755 (executable)
@@ -66,6 +66,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).
@@ -115,7 +121,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
 
     ifconfig $interface $new_ip_address $new_subnet_arg \
-                                                       $new_broadcast_arg
+                               $new_broadcast_arg $mtu_arg $metric_arg
     for router in $new_routers; do
       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
        route add -host $router dev $interface
@@ -155,7 +161,7 @@ if [ x$reason = xTIMEOUT ]; then
     ifconfig $interface:0- 0.0.0.0
   fi
   ifconfig $interface $new_ip_address $new_subnet_arg \
-                                       $new_broadcast_arg
+                               $new_broadcast_arg $mtu_arg $metric_arg
   set $new_routers
   if ping -q -c 1 $1; then
     if [ x$new_ip_address != x$alias_ip_address ] && \
index c2403dc302761642a7a9d34a4f6068af6789680d..4a5452c4140776752b028860601139bec94c0c87 100755 (executable)
@@ -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