libdns refactoring: get rid of multiple versions of dns_keytable_add, dns_iptable_addprefix and dns_iptable_addprefix
This commit is contained in:
@@ -632,6 +632,7 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
const cfg_listelt_t *elt;
|
||||
dns_iptable_t *iptab;
|
||||
int new_nest_level = 0;
|
||||
isc_boolean_t setpos;
|
||||
|
||||
if (nest_level != 0)
|
||||
new_nest_level = nest_level - 1;
|
||||
@@ -710,7 +711,7 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
/* Network prefix */
|
||||
isc_netaddr_t addr;
|
||||
unsigned int bitlen;
|
||||
isc_boolean_t setpos, setecs;
|
||||
isc_boolean_t setecs;
|
||||
|
||||
cfg_obj_asnetprefix(ce, &addr, &bitlen);
|
||||
if (family != 0 && family != addr.family) {
|
||||
@@ -739,8 +740,8 @@ cfg_acl_fromconfig2(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
||||
*/
|
||||
setpos = ISC_TF(nest_level != 0 || !neg);
|
||||
setecs = cfg_obj_istype(ce, &cfg_type_ecsprefix);
|
||||
result = dns_iptable_addprefix2(iptab, &addr, bitlen,
|
||||
setpos, setecs);
|
||||
result = dns_iptable_addprefix(iptab, &addr, bitlen,
|
||||
setpos, setecs);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
@@ -812,8 +813,10 @@ nested_acl:
|
||||
const char *name = cfg_obj_asstring(ce);
|
||||
if (strcasecmp(name, "any") == 0) {
|
||||
/* Iptable entry with zero bit length. */
|
||||
setpos = ISC_TF(nest_level != 0 || !neg);
|
||||
result = dns_iptable_addprefix(iptab, NULL, 0,
|
||||
ISC_TF(nest_level != 0 || !neg));
|
||||
setpos,
|
||||
ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
@@ -831,8 +834,10 @@ nested_acl:
|
||||
* de->negative to true so we can handle
|
||||
* "!none;".
|
||||
*/
|
||||
setpos = ISC_TF(nest_level != 0 || neg);
|
||||
result = dns_iptable_addprefix(iptab, NULL, 0,
|
||||
ISC_TF(nest_level != 0 || neg));
|
||||
setpos,
|
||||
ISC_FALSE);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user