From a5614a5019db4625afc2211e0271e51eb03c3cd3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 21 Apr 2019 19:18:06 +0200 Subject: [PATCH] gluon-neighbour-info: fix outgoing interface for non-link-local multicast addresses --- .../gluon-neighbour-info/src/gluon-neighbour-info.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package/gluon-neighbour-info/src/gluon-neighbour-info.c b/package/gluon-neighbour-info/src/gluon-neighbour-info.c index d0df56ab..24237bfe 100644 --- a/package/gluon-neighbour-info/src/gluon-neighbour-info.c +++ b/package/gluon-neighbour-info/src/gluon-neighbour-info.c @@ -220,6 +220,16 @@ int main(int argc, char **argv) { 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) { fputs("Content-Type: text/event-stream\n\n", stdout); fflush(stdout);