[master] fix dig=+subnet zero-length prefix

4303.	[bug]		"dig +subnet" was unable to send a prefix length of
			zero, as it was incorrectly changed to 32 for v4
			prefixes or 128 for v6 prefixes. In addition to
			fixing this, "dig +subnet=0" has been added as a
			short form for 0.0.0.0/0. The same changes have
			also been made in "mdig". [RT #41553]
This commit is contained in:
Evan Hunt
2016-01-27 19:00:36 -08:00
parent 30370d905e
commit 8ede7a974b
7 changed files with 73 additions and 16 deletions

View File

@@ -250,6 +250,30 @@ if [ -x ${DIG} ] ; then
grep "CLIENT-SUBNET: 127.0.0.1/32/0" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking dig +subnet=0/0 ($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.2 +subnet=0/0 A a.example > dig.out.test$n 2>&1 || ret=1
grep "CLIENT-SUBNET: 0.0.0.0/0/0" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking dig +subnet=0 ($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.2 +subnet=0 A a.example > dig.out.test$n 2>&1 || ret=1
grep "CLIENT-SUBNET: 0.0.0.0/0/0" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking dig +subnet=::/0 ($n)"
ret=0
$DIG $DIGOPTS +tcp @10.53.0.2 +subnet=::/0 A a.example > dig.out.test$n 2>&1 || ret=1
grep "CLIENT-SUBNET: ::/0/0" < dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking dig +sp works as an abbriviated form of split ($n)"