789. [bug] The "localhost" and "localnets" ACLs did not match

when used as the second element of a two-element
                        sortlist item.
This commit is contained in:
Andreas Gustafsson
2001-03-26 23:36:00 +00:00
parent eb059776a2
commit 34613b2e39
2 changed files with 14 additions and 3 deletions

View File

@@ -1,4 +1,8 @@
789. [bug] The "localhost" and "localnets" ACLs did not match
when used as the second element of a two-element
sortlist item.
788. [func] Add the "match-mapped-addresses" option, which
causes IPv6 v4mapped addresses to be treated as
IPv4 addresses for the purpose of acl matching.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sortlist.c,v 1.4 2001/01/09 21:40:04 bwelling Exp $ */
/* $Id: sortlist.c,v 1.5 2001/03/26 23:36:00 gson Exp $ */
#include <config.h>
@@ -62,9 +62,16 @@ ns_sortlist_setup(dns_acl_t *acl, isc_netaddr_t *clientaddr, void **argp) {
&matchelt)) {
if (inner->length == 2) {
dns_aclelement_t *elt1 = &inner->elements[1];
if (elt1->type != dns_aclelementtype_nestedacl)
if (elt1->type == dns_aclelementtype_nestedacl)
*argp = elt1->u.nestedacl;
else if (elt1->type == dns_aclelementtype_localhost &&
ns_g_server->aclenv.localhost != NULL)
*argp = ns_g_server->aclenv.localhost;
else if (elt1->type == dns_aclelementtype_localnets &&
ns_g_server->aclenv.localnets != NULL)
*argp = ns_g_server->aclenv.localnets;
else
goto dont_sort;
*argp = elt1->u.nestedacl;
return (NS_SORTLISTTYPE_2ELEMENT);
} else {
INSIST(matchelt != NULL);