Commit 8f3194f7 authored by Simon Kelley's avatar Simon Kelley

Do multicast interface selection portably for router advertisements.

parent 10bd2926
...@@ -391,10 +391,13 @@ static void send_ra(time_t now, int iface, char *iface_name, struct in6_addr *de ...@@ -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());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment