diff options
-rw-r--r-- | RELNOTES | 8 | ||||
-rwxr-xr-x | client/scripts/bsdos | 22 | ||||
-rwxr-xr-x | client/scripts/freebsd | 30 | ||||
-rwxr-xr-x | client/scripts/linux | 27 | ||||
-rwxr-xr-x | client/scripts/macos | 11 | ||||
-rwxr-xr-x | client/scripts/netbsd | 22 | ||||
-rw-r--r-- | client/scripts/openbsd | 26 | ||||
-rwxr-xr-x | client/scripts/openwrt | 25 | ||||
-rwxr-xr-x | client/scripts/solaris | 13 |
9 files changed, 173 insertions, 11 deletions
@@ -148,6 +148,14 @@ work on other platforms. Please report any problems and suggested fixes to to perform an fsync() operation on the lease database before reply, which improves performance. [ISC-Bugs #22228] +- Client Script fixes + [ISC-Bugs #23045] Typos in client/scripts/openbsd + [ISC-Bugs #23565] In the client scripts add a zone id (interface id) if + the domain search address is link local. + [ISC-Bugs #1277] In some of the client scripts add code to handle the + case of the default router information being changed without the address + being changed. + Changes since 4.2.0 - Documentation cleanup covering multiple tickets diff --git a/client/scripts/bsdos b/client/scripts/bsdos index e226f802..2cbcdfbf 100755 --- a/client/scripts/bsdos +++ b/client/scripts/bsdos @@ -24,7 +24,14 @@ make_resolv_conf() { echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 fi for nameserver in ${new_dhcp6_name_servers} ; do - echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + case $nameserver in + fe80:*) zone_id="%$interface";; + FE80:*) zone_id="%$interface";; + *) zone_id='';; + esac + echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 done mv /etc/resolv.conf.dhclient6 /etc/resolv.conf @@ -151,6 +158,19 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ shift; shift done fi + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + $LOGGER "New Routers: $new_routers" + for router in $old_routers; do + route delete default $router >/dev/null 2>&1 + done + for router in $new_routers; do + route add default $router >/dev/null 2>&1 + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then diff --git a/client/scripts/freebsd b/client/scripts/freebsd index ac215ee4..3f89dee9 100755 --- a/client/scripts/freebsd +++ b/client/scripts/freebsd @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: freebsd,v 1.23 2009/04/21 14:09:57 pselkirk Exp $ +# $Id: freebsd,v 1.24 2011/05/18 19:55:44 sar Exp $ # # $FreeBSD$ @@ -59,7 +59,14 @@ make_resolv_conf() { if [ $exit_status -ne 0 ] ; then break fi - ( echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 ) + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + case $nameserver in + fe80:*) zone_id="%$interface";; + FE80:*) zone_id="%$interface";; + *) zone_id='';; + esac + ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 ) exit_status=$? done @@ -208,6 +215,25 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ shift; shift done fi + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + $LOGGER "New Routers: $new_routers" + for router in $old_routers; do + route delete default $router >/dev/null 2>&1 + done + for router in $new_routers; do + # If the subnet is captive, eg the netmask is /32 but the default + # gateway is (obviously) outside of this, then we need to produce a + # host route to reach the gateway. + if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then + route add -host $router -interface $interface + fi + route add default $router >/dev/null 2>&1 + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then diff --git a/client/scripts/linux b/client/scripts/linux index 4326ce95..14655f04 100755 --- a/client/scripts/linux +++ b/client/scripts/linux @@ -49,9 +49,19 @@ make_resolv_conf() { if [ "x${new_dhcp6_domain_search}" != x ] ; then echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 fi + shopt -s nocasematch for nameserver in ${new_dhcp6_name_servers} ; do - echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + if [[ "$nameserver" =~ ^fe80:: ]] + then + zone_id="%$interface" + else + zone_id= + fi + echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 done + shopt -u nocasematch mv /etc/resolv.conf.dhclient6 /etc/resolv.conf fi @@ -161,6 +171,21 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ fi route add default gw $router $metric_arg dev $interface done + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + for router in $old_routers; do + route del default gw $router + done + 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 $metric_arg dev $interface + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then diff --git a/client/scripts/macos b/client/scripts/macos index 1beacd88..ad8d6020 100755 --- a/client/scripts/macos +++ b/client/scripts/macos @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: macos,v 1.2 2008/11/03 23:32:12 dhankins Exp $ +# $Id: macos,v 1.3 2011/05/18 19:55:44 sar Exp $ # # automous run of this script will commit the DNS setting # @@ -29,7 +29,14 @@ make_resolv_conf() { if [ $exit_status -ne 0 ]; then break fi - ( echo nameserver ${nameserver} >> /var/run/resolv.conf.dhclient6 ) + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + case $nameserver in + fe80:*) zone_id="%$interface";; + FE80:*) zone_id="%$interface";; + *) zone_id='';; + esac + ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 ) exit_status=$? done diff --git a/client/scripts/netbsd b/client/scripts/netbsd index af6b3c95..77b0fba2 100755 --- a/client/scripts/netbsd +++ b/client/scripts/netbsd @@ -24,7 +24,14 @@ make_resolv_conf() { echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 fi for nameserver in ${new_dhcp6_name_servers} ; do - echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + case $nameserver in + fe80:*) zone_id="%$interface";; + FE80:*) zone_id="%$interface";; + *) zone_id='';; + esac + echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 done mv /etc/resolv.conf.dhclient6 /etc/resolv.conf @@ -151,6 +158,19 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ shift; shift done fi + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + $LOGGER "New Routers: $new_routers" + for router in $old_routers; do + route delete default $router >/dev/null 2>&1 + done + for router in $new_routers; do + route add default $router >/dev/null 2>&1 + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then diff --git a/client/scripts/openbsd b/client/scripts/openbsd index 182c7d6c..ce22d753 100644 --- a/client/scripts/openbsd +++ b/client/scripts/openbsd @@ -1,7 +1,7 @@ #!/bin/sh make_resolv_conf() { - if x"$new_domain_name_servers" != x ]; then + if [ x"$new_domain_name_servers" != x ]; then cat /dev/null > /etc/resolv.conf.dhclient if [ x"$new_domain_search" != x ]; then echo search $new_domain_search >> /etc/resolv.conf.dhclient @@ -15,7 +15,7 @@ make_resolv_conf() { echo nameserver $nameserver >>/etc/resolv.conf.dhclient done - mv /etc/ersolv.conf.dhclient /etc/resolv.conf + mv /etc/resolv.conf.dhclient /etc/resolv.conf elif [ "x${new_dhcp6_name_servers}" != x ] ; then cat /dev/null > /etc/resolv.conf.dhclient6 chmod 644 /etc/resolv.conf.dhclient6 @@ -24,7 +24,14 @@ make_resolv_conf() { echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 fi for nameserver in ${new_dhcp6_name_servers} ; do - echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + case $nameserver in + fe80:*) zone_id="%$interface";; + FE80:*) zone_id="%$interface";; + *) zone_id='';; + esac + echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 done mv /etc/resolv.conf.dhclient6 /etc/resolv.conf @@ -145,6 +152,19 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ shift; shift done fi + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + $LOGGER "New Routers: $new_routers" + for router in $old_routers; do + route delete default $router >/dev/null 2>&1 + done + for router in $new_routers; do + route add default $router >/dev/null 2>&1 + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then diff --git a/client/scripts/openwrt b/client/scripts/openwrt index 29d100f0..9d434ad3 100755 --- a/client/scripts/openwrt +++ b/client/scripts/openwrt @@ -25,7 +25,14 @@ make_resolv_conf() { echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 fi for nameserver in ${new_dhcp6_name_servers} ; do - echo nameserver ${nameserver} >> /etc/resolv.conf.dhclient6 + # If the nameserver has a link-local address + # add a <zone_id> (interface name) to it. + case $nameserver in + fe80:*) zone_id="%$interface";; + FE80:*) zone_id="%$interface";; + *) zone_id='';; + esac + echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 done mv /etc/resolv.conf.dhclient6 /etc/resolv.conf @@ -128,6 +135,22 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ fi route add default gw $router done + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + $LOGGER "New Routers: $new_routers" + for router in $old_routers; do + route delete default $router + done + 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 + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then diff --git a/client/scripts/solaris b/client/scripts/solaris index 4a5452c4..af553b9d 100755 --- a/client/scripts/solaris +++ b/client/scripts/solaris @@ -128,6 +128,19 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \ for router in $new_routers; do route add default $router 1 >/dev/null 2>&1 done + else + # we haven't changed the address, have we changed other options + # that we wish to update? + if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then + # if we've changed routers delete the old and add the new. + $LOGGER "New Routers: $new_routers" + for router in $old_routers; do + route delete default $router >/dev/null 2>&1 + done + for router in $new_routers; do + route add default $router 1 >/dev/null 2>&1 + done + fi fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then |