summaryrefslogtreecommitdiffhomepage
path: root/src/dhcpv6.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-03-29 17:03:29 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-03-30 14:48:02 +0200
commit3d9f4067d56660a2c75ab2ce9b801ae1a4ff4cde (patch)
treed3a1a5e9dedd1d4d32dc375e2bb37dfbd21016d3 /src/dhcpv6.c
parentbc6c3ace738fd4eb28c06be533f6bbc75d0587a5 (diff)
rework IPv6 dns address selection (FS#635)
Don't return anymore the link local IPv6 address as DNS IPv6 address since different OS implementations (e.g. android, ...) cannot handle a link local IPv6 address as DNS address. IPv6 DNS address selection is reworked as follows : -Consider all global/ULA IPv6 address having a valid lifetime -Give preference to global/ULA IPv6 addresses being not deprecated -Give preference to ULA IPv6 addresses over IPv6 global addresses -Give preference to the IPv6 address with the longest preferred lifetime in its selected category (ULA or global) -If no global/ULA IPv6 address is present use the IPv6 link local address Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv6.c')
-rw-r--r--src/dhcpv6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 4cd9e02..ebb0c80 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -232,7 +232,7 @@ static void handle_client_request(void *addr, void *data, size_t len,
size_t dns_cnt = iface->dns_cnt;
if ((dns_cnt == 0) &&
- !odhcpd_get_linklocal_interface_address(iface->ifindex, &dns_addr)) {
+ !odhcpd_get_interface_dns_addr(iface, &dns_addr)) {
dns_addr_ptr = &dns_addr;
dns_cnt = 1;
}
@@ -464,7 +464,7 @@ static void relay_server_response(uint8_t *data, size_t len)
size_t rewrite_cnt = iface->dns_cnt;
if (rewrite_cnt == 0) {
- if (odhcpd_get_linklocal_interface_address(iface->ifindex, &addr))
+ if (odhcpd_get_interface_dns_addr(iface, &addr))
return; // Unable to get interface address
rewrite = &addr;