summaryrefslogtreecommitdiffhomepage
path: root/src/router.c
diff options
context:
space:
mode:
authorsbyx <steven@midlink.org>2014-10-30 14:23:35 +0100
committersbyx <steven@midlink.org>2014-10-30 14:23:35 +0100
commitee243b09f3c81f824cc463c1c757e905f882350e (patch)
tree4e23443cfbfc557a5babdf262e73f8898c9f3e34 /src/router.c
parenta408b9648f04962113ee6bf3d4a2dbddc9b0394e (diff)
parentd94b406eeba27af2a6abff333dc16e82d28ed636 (diff)
Merge pull request #30 from dedeckeh/bugfixes
Fix IPv6 DNS server adddress selection
Diffstat (limited to 'src/router.c')
-rw-r--r--src/router.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/router.c b/src/router.c
index 0b15dac..3d26c58 100644
--- a/src/router.c
+++ b/src/router.c
@@ -537,7 +537,6 @@ static void forward_router_advertisement(uint8_t *data, size_t len)
struct sockaddr_in6 all_nodes = {AF_INET6, 0, 0, ALL_IPV6_NODES, 0};
struct iovec iov = {data, len};
- struct odhcpd_ipaddr addr;
struct interface *iface;
list_for_each_entry(iface, &interfaces, head) {
if (iface->ra != RELAYD_RELAY || iface->master)
@@ -550,13 +549,14 @@ static void forward_router_advertisement(uint8_t *data, size_t len)
// If we have to rewrite DNS entries
if (iface->always_rewrite_dns && dns_ptr && dns_count > 0) {
const struct in6_addr *rewrite = iface->dns;
+ struct in6_addr addr;
size_t rewrite_cnt = iface->dns_cnt;
if (rewrite_cnt == 0) {
- if (odhcpd_get_interface_addresses(iface->ifindex, &addr, 1) < 1)
+ if (odhcpd_get_preferred_interface_address(iface->ifindex, &addr) < 1)
continue; // Unable to comply
- rewrite = &addr.addr;
+ rewrite = &addr;
rewrite_cnt = 1;
}