+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]
* 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>
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;
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.
*/
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 &&