Skip to content

Commit

Permalink
conf: fix address issue when configuring multiple IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Jul 1, 2023
1 parent e66928f commit 087c9f5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/dns_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ static int _conf_domain_rule_address(char *domain, const char *domain_address)
goto errout;
}

addr_len = sizeof(addr);
if (getaddr_by_host(ip, (struct sockaddr *)&addr, &addr_len) != 0) {
goto errout;
}
Expand All @@ -1594,10 +1595,6 @@ static int _conf_domain_rule_address(char *domain, const char *domain_address)
memcpy(ipv4_addr[ipv4_num], addr_in6->sin6_addr.s6_addr + 12, DNS_RR_A_LEN);
ipv4_num++;
} else {
address_ipv6 = _new_dns_rule(DOMAIN_RULE_ADDRESS_IPV6);
if (address_ipv6 == NULL) {
goto errout;
}
memcpy(ipv6_addr[ipv6_num], addr_in6->sin6_addr.s6_addr, DNS_RR_AAAA_LEN);
ipv6_num++;
}
Expand Down

0 comments on commit 087c9f5

Please sign in to comment.