diff --git a/CHANGES b/CHANGES index 40dfa50038..04f374a739 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1051. [bug] Do not ignore a network interface completely just + because it has a noncontiguous netmask. Instead, + omit it from the localnets ACL and issue a warning. + [RT #1891] + 1050. [bug] Log messages reporting malformed IP addresses in address lists such as that of the forwarders option failed to include the correct error code, file diff --git a/bin/named/interfacemgr.c b/bin/named/interfacemgr.c index b9853edaf1..099f8a57b0 100644 --- a/bin/named/interfacemgr.c +++ b/bin/named/interfacemgr.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: interfacemgr.c,v 1.62 2001/10/11 00:02:34 gson Exp $ */ +/* $Id: interfacemgr.c,v 1.63 2001/10/12 23:05:58 gson Exp $ */ #include @@ -515,23 +515,32 @@ do_ipv4(ns_interfacemgr_t *mgr) { if (isc_netaddr_equal(&interface.address, &zero_address)) continue; - result = isc_netaddr_masktoprefixlen(&interface.netmask, - &prefixlen); - if (result != ISC_R_SUCCESS) - goto ignore_interface; elt.type = dns_aclelementtype_ipprefix; elt.negative = ISC_FALSE; elt.u.ip_prefix.address = interface.address; - elt.u.ip_prefix.prefixlen = prefixlen; - /* XXX suppress duplicates */ - result = dns_acl_appendelement(mgr->aclenv.localnets, &elt); - if (result != ISC_R_SUCCESS) - goto ignore_interface; elt.u.ip_prefix.prefixlen = 32; result = dns_acl_appendelement(mgr->aclenv.localhost, &elt); if (result != ISC_R_SUCCESS) goto ignore_interface; + result = isc_netaddr_masktoprefixlen(&interface.netmask, + &prefixlen); + if (result != ISC_R_SUCCESS) { + isc_log_write(IFMGR_COMMON_LOGARGS, + ISC_LOG_WARNING, + "omitting IPv4 interface %s from " + "localnets ACL: %s", + interface.name, + isc_result_totext(result)); + } else { + elt.u.ip_prefix.prefixlen = prefixlen; + /* XXX suppress duplicates */ + result = dns_acl_appendelement(mgr->aclenv.localnets, + &elt); + if (result != ISC_R_SUCCESS) + goto ignore_interface; + } + for (le = ISC_LIST_HEAD(mgr->listenon4->elts); le != NULL; le = ISC_LIST_NEXT(le, link))