Commit 22fa4e32 authored by Mark Andrews's avatar Mark Andrews
Browse files

1578. [bug] Don't use CLASS E IPv4 addresses when resolving.

                        [RT #10346]
parent 7436bb66
......@@ -10,7 +10,8 @@
1579. [placeholder] rt3746a
1578. [placeholder] rt10346
1578. [bug] Don't use CLASS E IPv4 addresses when resolving.
[RT #10346]
1577. [placeholder] rt10331
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.280 2004/02/03 00:59:05 marka Exp $ */
/* $Id: resolver.c,v 1.281 2004/02/20 00:52:45 marka Exp $ */
#include <config.h>
......@@ -2025,6 +2025,9 @@ possibly_mark(fetchctx_t *fctx, dns_adbaddrinfo_t *addr)
} else if (isc_sockaddr_ismulticast(sa)) {
addr->flags |= FCTX_ADDRINFO_MARK;
msg = "ignoring multicast address: ";
} else if (isc_sockaddr_isexperimental(sa)) {
addr->flags |= FCTX_ADDRINFO_MARK;
msg = "ignoring experimental address: ";
} else if (sa->type.sa.sa_family != AF_INET6) {
return;
} else if (IN6_IS_ADDR_V4MAPPED(&sa->type.sin6.sin6_addr)) {
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: netaddr.h,v 1.23 2002/10/28 02:16:20 marka Exp $ */
/* $Id: netaddr.h,v 1.24 2004/02/20 00:52:46 marka Exp $ */
#ifndef ISC_NETADDR_H
#define ISC_NETADDR_H 1
......@@ -119,6 +119,12 @@ isc_netaddr_ismulticast(isc_netaddr_t *na);
* Returns ISC_TRUE if the address is a multicast address.
*/
isc_boolean_t
isc_netaddr_isexperimental(isc_netaddr_t *na);
/*
* Returns ISC_TRUE if the address is a experimental (CLASS E) address.
*/
isc_boolean_t
isc_netaddr_islinklocal(isc_netaddr_t *na);
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.h,v 1.40 2003/07/25 02:22:26 marka Exp $ */
/* $Id: sockaddr.h,v 1.41 2004/02/20 00:52:46 marka Exp $ */
#ifndef ISC_SOCKADDR_H
#define ISC_SOCKADDR_H 1
......@@ -173,6 +173,12 @@ isc_sockaddr_ismulticast(isc_sockaddr_t *sa);
* Returns ISC_TRUE if the address is a multicast address.
*/
isc_boolean_t
isc_sockaddr_isexperimental(isc_sockaddr_t *sa);
/*
* Returns ISC_TRUE if the address is a experimental (CLASS E) address.
*/
isc_boolean_t
isc_sockaddr_islinklocal(isc_sockaddr_t *sa);
/*
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: netaddr.c,v 1.25 2002/10/28 02:23:53 marka Exp $ */
/* $Id: netaddr.c,v 1.26 2004/02/20 00:52:45 marka Exp $ */
#include <config.h>
......@@ -23,6 +23,7 @@
#include <isc/buffer.h>
#include <isc/msgs.h>
#include <isc/net.h>
#include <isc/netaddr.h>
#include <isc/print.h>
#include <isc/sockaddr.h>
......@@ -305,6 +306,16 @@ isc_netaddr_ismulticast(isc_netaddr_t *na) {
}
}
isc_boolean_t
isc_netaddr_isexperimental(isc_netaddr_t *na) {
switch (na->family) {
case AF_INET:
return (ISC_TF(ISC_IPADDR_ISEXPERIMENTAL(na->type.in.s_addr)));
default:
return (ISC_FALSE); /* XXXMLG ? */
}
}
isc_boolean_t
isc_netaddr_islinklocal(isc_netaddr_t *na) {
switch (na->family) {
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.57 2003/07/25 02:22:26 marka Exp $ */
/* $Id: sockaddr.c,v 1.58 2004/02/20 00:52:45 marka Exp $ */
#include <config.h>
......@@ -421,6 +421,17 @@ isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
return (isc_netaddr_ismulticast(&netaddr));
}
isc_boolean_t
isc_sockaddr_isexperimental(isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET) {
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
return (isc_netaddr_isexperimental(&netaddr));
}
return (ISC_FALSE);
}
isc_boolean_t
isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: net.h,v 1.37 2003/01/16 03:59:27 marka Exp $ */
/* $Id: net.h,v 1.38 2004/02/20 00:52:46 marka Exp $ */
#ifndef ISC_NET_H
#define ISC_NET_H 1
......@@ -230,6 +230,10 @@ typedef isc_uint16_t in_port_t;
(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
== ISC__IPADDR(0xe0000000))
#define ISC_IPADDR_ISEXPERIMENTAL(i) \
(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
== ISC__IPADDR(0xf0000000))
/***
*** Functions.
***/
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: net.h,v 1.19 2003/01/16 03:59:28 marka Exp $ */
/* $Id: net.h,v 1.20 2004/02/20 00:52:46 marka Exp $ */
#ifndef ISC_NET_H
#define ISC_NET_H 1
......@@ -139,6 +139,10 @@ typedef isc_uint16_t in_port_t;
(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
== ISC__IPADDR(0xe0000000))
#define ISC_IPADDR_ISEXPERIMENTAL(i) \
(((isc_uint32_t)(i) & ISC__IPADDR(0xf0000000)) \
== ISC__IPADDR(0xf0000000))
/*
* Fix the FD_SET and FD_CLR Macros to properly cast
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment