mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 23:02:05 -04:00
Handle new dns_c_ipmatch_any type in address lists. Use (negated)
when parsing address 'none'. Also make better use of localhost and localnets ipmatch elements.
This commit is contained in:
parent
7d1c47756f
commit
334e2ce758
1 changed files with 50 additions and 11 deletions
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
#if !defined(lint) && !defined(SABER)
|
||||
static char rcsid[] = "$Id: confparser.y,v 1.41 2000/02/14 17:20:35 brister Exp $";
|
||||
static char rcsid[] = "$Id: confparser.y,v 1.42 2000/02/15 17:05:11 brister Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -2439,20 +2439,59 @@ address_name: any_string
|
|||
dns_c_ipmatchelement_t *elem;
|
||||
dns_c_acl_t *acl;
|
||||
|
||||
tmpres = dns_c_acltable_getacl(currcfg->acls,
|
||||
$1, &acl);
|
||||
if (tmpres == ISC_R_NOTFOUND) {
|
||||
parser_warning(ISC_FALSE,
|
||||
"undefined acl ``%s'' referenced",
|
||||
$1);
|
||||
elem = NULL;
|
||||
} else {
|
||||
tmpres = dns_c_ipmatch_aclnew(currcfg->mem, &elem, $1);
|
||||
if (strcmp($1, "any") == 0) {
|
||||
tmpres = dns_c_ipmatchany_new(currcfg->mem, &elem);
|
||||
if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"failed to create IPE-ACL");
|
||||
"failed to create ``any''"
|
||||
" ipmatch element");
|
||||
YYABORT;
|
||||
}
|
||||
} else if (strcmp($1, "none") == 0) {
|
||||
tmpres = dns_c_ipmatchany_new(currcfg->mem, &elem);
|
||||
if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"failed to create ``any''"
|
||||
" ipmatch element");
|
||||
YYABORT;
|
||||
}
|
||||
dns_c_ipmatch_negate(elem);
|
||||
} else if (strcmp($1, "localhost") == 0) {
|
||||
tmpres = dns_c_ipmatchlocalhost_new(currcfg->mem,
|
||||
&elem);
|
||||
if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"failed to create ``localhost''"
|
||||
" ipmatch element");
|
||||
YYABORT;
|
||||
}
|
||||
} else if (strcmp($1, "localnets") == 0) {
|
||||
tmpres = dns_c_ipmatchlocalnets_new(currcfg->mem,
|
||||
&elem);
|
||||
if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"failed to create ``localnets''"
|
||||
" ipmatch element");
|
||||
YYABORT;
|
||||
}
|
||||
} else {
|
||||
tmpres = dns_c_acltable_getacl(currcfg->acls,
|
||||
$1, &acl);
|
||||
if (tmpres == ISC_R_NOTFOUND) {
|
||||
parser_warning(ISC_FALSE,
|
||||
"undefined acl ``%s'' "
|
||||
"referenced", $1);
|
||||
elem = NULL;
|
||||
} else {
|
||||
tmpres = dns_c_ipmatch_aclnew(currcfg->mem,
|
||||
&elem, $1);
|
||||
if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE,
|
||||
"failed to create "
|
||||
"IPE-ACL");
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isc_mem_free(memctx, $1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue