]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorBrian Wellington <source@isc.org>
Fri, 16 Nov 2001 21:21:42 +0000 (21:21 +0000)
committerBrian Wellington <source@isc.org>
Fri, 16 Nov 2001 21:21:42 +0000 (21:21 +0000)
1131.   [bug]           The match-destinations view option did not work with
                        IPv6 destinations. [RT #2073, #2074]

CHANGES
bin/named/client.c

diff --git a/CHANGES b/CHANGES
index f57076e7ce03e16bb7bf3c3ec3b4b7e11a612e6b..ebfbd65ecd281679ff6c20a7442da8e8457bea84 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1131.  [bug]           The match-destinations view option did not work with
+                       IPv6 destinations. [RT #2073, #2074]
+
 1130.  [bug]           Log messages reporting an out-of-range serial number
                        did not include the out-of-range number but the
                        following token. [RT #2076]
index 73906288e32d3e0189995a5f26cdd47ec8df1a57..ef9fc19af8db239804a4935451e26c70ced355c7 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: client.c,v 1.176.2.7 2001/11/15 02:51:44 marka Exp $ */
+/* $Id: client.c,v 1.176.2.8 2001/11/16 21:21:42 bwelling Exp $ */
 
 #include <config.h>
 
@@ -1064,6 +1064,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
        dns_rdataset_t *opt;
        isc_boolean_t ra;       /* Recursion available. */
        isc_netaddr_t netaddr;
+       isc_netaddr_t destaddr;
        int match;
        dns_messageid_t id;
        unsigned int flags;
@@ -1284,6 +1285,20 @@ client_request(isc_task_t *task, isc_event_t *event) {
                goto cleanup;
        }
 
+       /*
+        * Determine the destination address.  For IPv6, we get this from the
+        * pktinfo structure (if supported).  For IPv4, we have to make do with
+        * the address of the interface where the request was received.
+        */
+       if (client->interface->addr.type.sa.sa_family == AF_INET6) {
+               if ((client->attributes & NS_CLIENTATTR_PKTINFO) != 0)
+                       isc_netaddr_fromin6(&destaddr, &client->pktinfo.ipi6_addr);
+               else
+                       isc_netaddr_any6(&destaddr);
+       } else {
+               isc_netaddr_fromsockaddr(&destaddr, &client->interface->addr);
+       }
+
        /*
         * Find a view that matches the client's source address.
         */
@@ -1293,10 +1308,6 @@ client_request(isc_task_t *task, isc_event_t *event) {
                if (client->message->rdclass == view->rdclass ||
                    client->message->rdclass == dns_rdataclass_any)
                {
-                       isc_netaddr_t destaddr;
-
-                       isc_netaddr_fromsockaddr(&destaddr,
-                                                &client->interface->addr); 
                        if (allowed(&netaddr, view->matchclients) &&
                            allowed(&destaddr, view->matchdestinations) &&
                            !((flags & DNS_MESSAGEFLAG_RD) == 0 &&