]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorBrian Wellington <source@isc.org>
Mon, 14 Aug 2000 19:52:20 +0000 (19:52 +0000)
committerBrian Wellington <source@isc.org>
Mon, 14 Aug 2000 19:52:20 +0000 (19:52 +0000)
 389. [bug] Attempting to send a reqeust over IPv6 using
dns_request_create() on a system without IPv6
support caused an assertion failure [RT #235].

CHANGES
lib/dns/request.c

diff --git a/CHANGES b/CHANGES
index 0a65dc25b94d95874701ee4d5126e734fc97578a..4a618e8e017547abd75207d0daaf5ab19e2e313f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+ 389.  [bug]           Attempting to send a reqeust over IPv6 using
+                       dns_request_create() on a system without IPv6
+                       support caused an assertion failure [RT #235].
+
+
  386.  [bug]           Missing strdup() of ACL name caused random
                        ACL matching failures [RT #228].
 
index f875f4cfa2b9165fbadd6c6f0a810e9814318229..e832b9e6e31ee15a1371639e433dd1fb09555e7b 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: request.c,v 1.26.2.2 2000/07/28 05:37:34 gson Exp $ */
+/* $Id: request.c,v 1.26.2.3 2000/08/14 19:52:18 bwelling Exp $ */
 
 #include <config.h>
 
@@ -525,19 +525,23 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
                if (result != ISC_R_SUCCESS)
                        goto cleanup;
        } else {
+               dns_dispatch_t *disp = NULL;
                switch (isc_sockaddr_pf(address)) {
                case PF_INET:
-                       dns_dispatch_attach(requestmgr->dispatchv4,
-                                           &request->dispatch);
+                       disp = requestmgr->dispatchv4;
                        break;
                case PF_INET6:
-                       dns_dispatch_attach(requestmgr->dispatchv6,
-                                           &request->dispatch);
+                       disp = requestmgr->dispatchv6;
                        break;
                default:
                        result = ISC_R_NOTIMPLEMENTED;
                        goto cleanup;
                }
+               if (disp == NULL) {
+                       result = ISC_R_NETUNREACH;
+                       goto cleanup;
+               }
+               dns_dispatch_attach(disp, &request->dispatch);
        }
        socket = dns_dispatch_getsocket(request->dispatch);
        INSIST(socket != NULL);