summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2013-09-30 15:04:58 +0100
committerSimon Kelley <simon@thekelleys.org.uk>2013-09-30 15:04:58 +0100
commit8f3194f7ac4590deeaf427fa40aa0f8d53588c05 (patch)
treee5e06222c9738836aee83beab72eac22abde0786
parent10bd29265b3aebf149bc5e93e91462732c9240de (diff)
downloaddnsmasq-8f3194f7ac4590deeaf427fa40aa0f8d53588c05.tar.gz
Do multicast interface selection portably for router advertisements.v2.67test17
-rw-r--r--src/radv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/radv.c b/src/radv.c
index d2b3977..b1f2bc1 100644
--- a/src/radv.c
+++ b/src/radv.c
@@ -391,10 +391,13 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de
addr.sin6_scope_id = iface;
}
else
- inet_pton(AF_INET6, ALL_NODES, &addr.sin6_addr);
+ {
+ inet_pton(AF_INET6, ALL_NODES, &addr.sin6_addr);
+ setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, &iface, sizeof(iface));
+ }
- send_from(daemon->icmp6fd, 0, daemon->outpacket.iov_base, save_counter(0),
- (union mysockaddr *)&addr, (struct all_addr *)&parm.link_local, iface);
+ while (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(0), 0,
+ (struct sockaddr *)&addr, sizeof(addr)) == -1 && retry_send());
}