pullup:
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:
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: interfacemgr.c,v 1.59.2.1 2001/10/11 01:20:31 marka Exp $ */
|
||||
/* $Id: interfacemgr.c,v 1.59.2.2 2001/10/13 03:56:44 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -505,23 +505,32 @@ do_ipv4(ns_interfacemgr_t *mgr) {
|
||||
if ((interface.flags & INTERFACE_F_UP) == 0)
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user