diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-03-29 17:03:29 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-03-30 14:48:02 +0200 |
commit | 3d9f4067d56660a2c75ab2ce9b801ae1a4ff4cde (patch) | |
tree | d3a1a5e9dedd1d4d32dc375e2bb37dfbd21016d3 /src/router.c | |
parent | bc6c3ace738fd4eb28c06be533f6bbc75d0587a5 (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/router.c')
-rw-r--r-- | src/router.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/router.c b/src/router.c index 6e5111a..feae5c7 100644 --- a/src/router.c +++ b/src/router.c @@ -319,7 +319,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add struct in6_addr dns_pref, *dns_addr = &dns_pref; size_t dns_cnt = 1; - odhcpd_get_linklocal_interface_address(iface->ifindex, &dns_pref); + odhcpd_get_interface_dns_addr(iface, &dns_pref); for (ssize_t i = 0; i < ipcnt; ++i) { struct odhcpd_ipaddr *addr = &addrs[i]; @@ -617,7 +617,7 @@ static void forward_router_advertisement(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)) continue; // Unable to comply rewrite = &addr; |