domain-rule: Exceptions are allowed when enable force-AAAA-SOA
This commit is contained in:
@@ -2227,19 +2227,23 @@ static int _config_qtype_soa(void *data, int argc, char *argv[])
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
soa_list = malloc(sizeof(*soa_list));
|
||||
if (soa_list == NULL) {
|
||||
tlog(TLOG_ERROR, "cannot malloc memory");
|
||||
return -1;
|
||||
}
|
||||
char sub_arg[1024];
|
||||
safe_strncpy(sub_arg, argv[i], sizeof(sub_arg));
|
||||
for (char *tok = strtok(sub_arg, ","); tok; tok = strtok(NULL, ",")) {
|
||||
soa_list = malloc(sizeof(*soa_list));
|
||||
if (soa_list == NULL) {
|
||||
tlog(TLOG_ERROR, "cannot malloc memory");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(soa_list, 0, sizeof(*soa_list));
|
||||
soa_list->qtypeid = atol(argv[i]);
|
||||
if (soa_list->qtypeid == DNS_T_AAAA) {
|
||||
dns_conf_force_AAAA_SOA = 1;
|
||||
memset(soa_list, 0, sizeof(*soa_list));
|
||||
soa_list->qtypeid = atol(tok);
|
||||
if (soa_list->qtypeid == DNS_T_AAAA) {
|
||||
dns_conf_force_AAAA_SOA = 1;
|
||||
}
|
||||
uint32_t key = hash_32_generic(soa_list->qtypeid, 32);
|
||||
hash_add(dns_qtype_soa_table.qtype, &soa_list->node, key);
|
||||
}
|
||||
uint32_t key = hash_32_generic(soa_list->qtypeid, 32);
|
||||
hash_add(dns_qtype_soa_table.qtype, &soa_list->node, key);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -3961,7 +3961,7 @@ static int _dns_server_pre_process_rule_flags(struct dns_request *request)
|
||||
|
||||
if (flags & DOMAIN_FLAG_ADDR_IGN) {
|
||||
/* ignore this domain */
|
||||
goto out;
|
||||
goto skip_soa_out;
|
||||
}
|
||||
|
||||
/* return specific type of address */
|
||||
@@ -3969,7 +3969,7 @@ static int _dns_server_pre_process_rule_flags(struct dns_request *request)
|
||||
case DNS_T_A:
|
||||
if (flags & DOMAIN_FLAG_ADDR_IPV4_IGN) {
|
||||
/* ignore this domain for A request */
|
||||
goto out;
|
||||
goto skip_soa_out;
|
||||
}
|
||||
|
||||
if (_dns_server_is_return_soa(request)) {
|
||||
@@ -3983,7 +3983,7 @@ static int _dns_server_pre_process_rule_flags(struct dns_request *request)
|
||||
case DNS_T_AAAA:
|
||||
if (flags & DOMAIN_FLAG_ADDR_IPV6_IGN) {
|
||||
/* ignore this domain for A request */
|
||||
goto out;
|
||||
goto skip_soa_out;
|
||||
}
|
||||
|
||||
if (_dns_server_is_return_soa(request)) {
|
||||
@@ -4007,7 +4007,8 @@ static int _dns_server_pre_process_rule_flags(struct dns_request *request)
|
||||
if (_dns_server_is_return_soa(request)) {
|
||||
goto soa;
|
||||
}
|
||||
|
||||
skip_soa_out:
|
||||
request->skip_qtype_soa = 1;
|
||||
out:
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user