cache: fix dns cache prefetch issue

This commit is contained in:
Nick Peng
2022-06-25 20:24:27 +08:00
parent 883116708b
commit 5006059074
4 changed files with 78 additions and 41 deletions

View File

@@ -913,6 +913,7 @@ static int _config_bind_ip(int argc, char *argv[], DNS_BIND_TYPE type)
char group_name[DNS_GROUP_NAME_LEN];
const char *group = NULL;
unsigned int server_flag = 0;
int i = 0;
/* clang-format off */
static struct option long_options[] = {
@@ -940,6 +941,20 @@ static int _config_bind_ip(int argc, char *argv[], DNS_BIND_TYPE type)
return 0;
}
for (i = 0; i < dns_conf_bind_ip_num; i++) {
bind_ip = &dns_conf_bind_ip[i];
if (bind_ip->type != type) {
continue;
}
if (strncmp(bind_ip->ip, ip, DNS_MAX_IPLEN) != 0) {
continue;
}
tlog(TLOG_WARN, "Bind server %s, type %d, already configured, skip.", ip, type);
return 0;
}
bind_ip = &dns_conf_bind_ip[index];
bind_ip->type = type;
bind_ip->flags = 0;