2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

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]
This commit is contained in:
Andreas Gustafsson
2001-10-12 23:05:58 +00:00
parent 62a3dbe63e
commit fa2fb620c7
2 changed files with 24 additions and 10 deletions

View File

@@ -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 1050. [bug] Log messages reporting malformed IP addresses in
address lists such as that of the forwarders option address lists such as that of the forwarders option
failed to include the correct error code, file failed to include the correct error code, file

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * 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 <config.h> #include <config.h>
@@ -515,23 +515,32 @@ do_ipv4(ns_interfacemgr_t *mgr) {
if (isc_netaddr_equal(&interface.address, &zero_address)) if (isc_netaddr_equal(&interface.address, &zero_address))
continue; continue;
result = isc_netaddr_masktoprefixlen(&interface.netmask,
&prefixlen);
if (result != ISC_R_SUCCESS)
goto ignore_interface;
elt.type = dns_aclelementtype_ipprefix; elt.type = dns_aclelementtype_ipprefix;
elt.negative = ISC_FALSE; elt.negative = ISC_FALSE;
elt.u.ip_prefix.address = interface.address; 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; elt.u.ip_prefix.prefixlen = 32;
result = dns_acl_appendelement(mgr->aclenv.localhost, &elt); result = dns_acl_appendelement(mgr->aclenv.localhost, &elt);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto ignore_interface; 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); for (le = ISC_LIST_HEAD(mgr->listenon4->elts);
le != NULL; le != NULL;
le = ISC_LIST_NEXT(le, link)) le = ISC_LIST_NEXT(le, link))