projects
/
project
/
odhcpd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix IPv6 DNS server adddress selection
[project/odhcpd.git]
/
src
/
router.c
diff --git
a/src/router.c
b/src/router.c
index
0b15dac
..
3d26c58
100644
(file)
--- 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 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)
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;
// 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) {
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
continue; // Unable to comply
- rewrite = &addr
.addr
;
+ rewrite = &addr;
rewrite_cnt = 1;
}
rewrite_cnt = 1;
}