2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

2456. [bug] In ACLs, ::/0 and 0.0.0.0/0 would both match any

address, regardless of family.  They now correctly
			distinguish IPv4 from IPv6.  [RT #18559]
This commit is contained in:
Evan Hunt
2008-09-26 21:12:02 +00:00
parent 106360491a
commit b0bf1ad5b0
5 changed files with 91 additions and 46 deletions

View File

@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: radix.h,v 1.10 2008/01/21 23:46:56 tbox Exp $ */
/* $Id: radix.h,v 1.11 2008/09/26 21:12:02 each Exp $ */
/*
* This source was adapted from MRT's RCS Ids:
@@ -37,7 +37,7 @@
#define NETADDR_TO_PREFIX_T(na,pt,bits) \
do { \
memset(&(pt), 0, sizeof(pt)); \
if((bits) && (na) != NULL) { \
if((na) != NULL) { \
(pt).family = (na)->family; \
(pt).bitlen = (bits); \
if ((pt).family == AF_INET6) { \
@@ -46,14 +46,16 @@
} else \
memcpy(&(pt).add.sin, &(na)->type.in, \
((bits)+7)/8); \
} else \
(pt).family = AF_INET; \
} else { \
(pt).family = AF_UNSPEC; \
(pt).bitlen = 0; \
} \
isc_refcount_init(&(pt).refcount, 0); \
} while(0)
typedef struct isc_prefix {
unsigned int family; /* AF_INET | AF_INET6 */
unsigned int bitlen;
unsigned int family; /* AF_INET | AF_INET6, or AF_UNSPEC for "any" */
unsigned int bitlen; /* 0 for "any" */
isc_refcount_t refcount;
union {
struct in_addr sin;