]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_9] fix dns_request_createvia assert
authorEvan Hunt <each@isc.org>
Wed, 23 Jan 2013 23:39:38 +0000 (15:39 -0800)
committerEvan Hunt <each@isc.org>
Wed, 23 Jan 2013 23:39:38 +0000 (15:39 -0800)
3474. [bug] nsupdate could assert when the local and remote
address families didn't match. [RT #22897]
(cherry picked from commit ffff5d67926821d3db8df63bdd84a9cb1ce56739)

CHANGES
bin/tests/system/nsupdate/tests.sh
lib/dns/request.c

diff --git a/CHANGES b/CHANGES
index c8b360f97b8384f9ce79cef3afe5aa85d276b3e7..d9c2684cc4d058823d241169ad63f9f57110cf19 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3474.  [bug]           nsupdate could assert when the local and remote
+                       address families didn't match. [RT #22897]
+
 3473.  [bug]           dnssec-signzone/verify could incorrectly report
                        an error condition due to an empty node above an
                        opt-out delegation lacking an NSEC3. [RT #32072]
index d0eba6403d8eb7f16b6d39d360781872c970018a..b9a1c90536b596cefc10b30bad9f7f6bd2d0bb99 100644 (file)
@@ -222,6 +222,17 @@ $DIG +tcp version.bind txt ch @10.53.0.1 -p 5300 > dig.out.ns1.$n
 grep "status: NOERROR" dig.out.ns1.$n > /dev/null || ret=1
 [ $ret = 0 ] || { echo I:failed; status=1; }
 
+n=`expr $n + 1`
+echo "I:check that address family mismatch is handled ($n)"
+$NSUPDATE <<END > /dev/null 2>&1 && ret=1
+server ::1
+local 127.0.0.1
+update add 600 txt.example.nil in txt "test"
+send
+END
+[ $ret = 0 ] || { echo I:failed; status=1; }
+
+
 n=`expr $n + 1`
 echo "I:check that unixtime serial number is correctly generated ($n)"
 oldserial=`$DIG +short unixtime.nil. soa @10.53.0.1 -p 5300 | awk '{print $3}'` || ret=1
index 58c0103f4c7e3073241368dc4778580481cfc61f..7285348aa6c00bd206da3b0164262e3b37534ba6 100644 (file)
@@ -894,13 +894,15 @@ dns_request_createvia3(dns_requestmgr_t *requestmgr, dns_message_t *message,
        REQUIRE(action != NULL);
        REQUIRE(requestp != NULL && *requestp == NULL);
        REQUIRE(timeout > 0);
-       if (srcaddr != NULL)
-               REQUIRE(isc_sockaddr_pf(srcaddr) == isc_sockaddr_pf(destaddr));
 
        mctx = requestmgr->mctx;
 
        req_log(ISC_LOG_DEBUG(3), "dns_request_createvia");
 
+       if (srcaddr != NULL &&
+           isc_sockaddr_pf(srcaddr) != isc_sockaddr_pf(destaddr))
+               return (ISC_R_FAMILYMISMATCH);
+
        if (isblackholed(requestmgr->dispatchmgr, destaddr))
                return (DNS_R_BLACKHOLED);