From 02ff45acbd755813b2d6023e114d2e8c01f1b97a Mon Sep 17 00:00:00 2001 From: ckb Date: Wed, 24 Oct 2012 14:51:06 -0500 Subject: [PATCH] 3402. [bug] Correct interface numbers for IPv4 and IPv6 interfaces. [RT #25085] --- CHANGES | 3 +++ bin/tests/system/ifconfig.sh | 36 +++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index c81b275017..8332005988 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3402. [bug] Correct interface numbers for IPv4 and IPv6 interfaces. + [RT #25085] + 3401. [bug] Addressed Coverity warnings. [RT #31484] 3400. [cleanup] "named -V" can now report a source ID string, defined diff --git a/bin/tests/system/ifconfig.sh b/bin/tests/system/ifconfig.sh index 1e1069fc1b..e98ab524e6 100644 --- a/bin/tests/system/ifconfig.sh +++ b/bin/tests/system/ifconfig.sh @@ -9,7 +9,7 @@ # # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -48,18 +48,18 @@ fi # on a NFS mounted disk. case `uname -a` in - *HP-UX*) sys=hpux ;; - *) sys=`sh $config_guess` ;; + *HP-UX*) sys=hpux ;; + *) sys=`sh $config_guess` ;; esac case "$2" in -[0-9]|[1-9][0-9]|[1-9][0-9][0-9]) base=$2;; -*) base="" + [1-9]|[1-9][0-9]|[1-9][0-9][0-9]) base=$2;; + *) base="1" esac case "$3" in -[0-9]|[1-9][0-9]|[1-9][0-9][0-9]) base6=$2;; -*) base6="" + [1-9]|[1-9][0-9]|[1-9][0-9][0-9]) base6=$3;; + *) base6=$base esac case "$1" in @@ -87,7 +87,7 @@ case "$1" in ifconfig lo0:$int 10.53.0.$ns netmask 0xffffffff up ;; *-*-solaris2.[8-9]|*-*-solaris2.1[0-9]) - /sbin/ifconfig lo0:$int plumb + /sbin/ifconfig lo0:$int plumb /sbin/ifconfig lo0:$int 10.53.0.$ns up if test -n "$int6" then @@ -99,7 +99,7 @@ case "$1" in *-*-linux*) ifconfig lo:$int 10.53.0.$ns up netmask 255.255.255.0 ifconfig lo inet6 add fd92:7065:b8e:ffff::$ns/64 - ;; + ;; *-unknown-freebsd*) ifconfig lo0 10.53.0.$ns alias netmask 0xffffffff ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias @@ -131,7 +131,7 @@ case "$1" in hpux) ifconfig lo0:$int 10.53.0.$ns netmask 255.255.255.0 up ifconfig lo0:$int inet6 fd92:7065:b8e:ffff::$ns up - ;; + ;; *-sco3.2v*) ifconfig lo0 alias 10.53.0.$ns ;; @@ -139,7 +139,7 @@ case "$1" in ifconfig lo0 alias 10.53.0.$ns ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns alias ;; - *) + *) echo "Don't know how to set up interface. Giving up." exit 1 esac @@ -153,7 +153,13 @@ case "$1" in then int=`expr $ns + $base - 1` else - int=$ns + int=$ns + fi + if test -n "$base6" + then + int6=`expr $ns + $base6 - 1` + else + int6=$ns fi case "$sys" in *-pc-solaris2.5.1) @@ -174,7 +180,7 @@ case "$1" in *-*-linux*) ifconfig lo:$int 10.53.0.$ns down ifconfig lo inet6 del fd92:7065:b8e:ffff::$ns/64 - ;; + ;; *-unknown-freebsd*) ifconfig lo0 10.53.0.$ns delete ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete @@ -206,7 +212,7 @@ case "$1" in hpux) ifconfig lo0:$int 0.0.0.0 ifconfig lo0:$int inet6 :: - ;; + ;; *-sco3.2v*) ifconfig lo0 -alias 10.53.0.$ns ;; @@ -214,7 +220,7 @@ case "$1" in ifconfig lo0 -alias 10.53.0.$ns ifconfig lo0 inet6 fd92:7065:b8e:ffff::$ns delete ;; - *) + *) echo "Don't know how to destroy interface. Giving up." exit 1 esac