Add ECS and bugfix
This commit is contained in:
@@ -134,6 +134,20 @@ int smartdns_add_servers(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int smartdns_set_ecs_ip(void)
|
||||
{
|
||||
int ret = 0;
|
||||
if (dns_conf_ipv4_ecs.enable) {
|
||||
ret |= dns_client_set_ecs(dns_conf_ipv4_ecs.ip, dns_conf_ipv4_ecs.subnet);
|
||||
}
|
||||
|
||||
if (dns_conf_ipv6_ecs.enable) {
|
||||
ret |= dns_client_set_ecs(dns_conf_ipv6_ecs.ip, dns_conf_ipv6_ecs.subnet);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int create_pid_file(const char *pid_file)
|
||||
{
|
||||
int fd;
|
||||
@@ -251,6 +265,11 @@ int smartdns_init(void)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
ret = smartdns_set_ecs_ip();
|
||||
if (ret != 0 ) {
|
||||
tlog(TLOG_WARN, "set ecs ip address failed.");
|
||||
}
|
||||
|
||||
return 0;
|
||||
errout:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user