gluon-neighbour-info: fix outgoing interface for non-link-local multicast addresses

This commit is contained in:
Matthias Schiffer 2019-04-21 19:18:06 +02:00
parent e9e1e2d18a
commit a5614a5019
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C

View File

@ -220,6 +220,16 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (client_addr.sin6_scope_id) {
if (setsockopt(
sock, IPPROTO_IPV6, IPV6_MULTICAST_IF,
&client_addr.sin6_scope_id, sizeof(client_addr.sin6_scope_id)
) < 0) {
perror("setsockopt");
exit(EXIT_FAILURE);
}
}
if (sse) { if (sse) {
fputs("Content-Type: text/event-stream\n\n", stdout); fputs("Content-Type: text/event-stream\n\n", stdout);
fflush(stdout); fflush(stdout);