Do multicast interface selection portably for router advertisements.

This commit is contained in:
Simon Kelley
2013-09-30 15:04:58 +01:00
parent 10bd29265b
commit 8f3194f7ac

View File

@@ -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; addr.sin6_scope_id = iface;
} }
else 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), while (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(0), 0,
(union mysockaddr *)&addr, (struct all_addr *)&parm.link_local, iface); (struct sockaddr *)&addr, sizeof(addr)) == -1 && retry_send());
} }