summaryrefslogtreecommitdiff
path: root/src/Erebos
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-10-11 21:03:31 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-10-11 21:05:59 +0200
commitc506520d28bfa9adb6c9cd2f8e719c1a35a84bbe (patch)
treebdd2491cd5822b78af807cf3e8aad42f4d6ca073 /src/Erebos
parent4a45d282d9b76d5858fe8df3dcd02b227e1e3f23 (diff)
Use only interfaces with non-link-local address for multicast
Diffstat (limited to 'src/Erebos')
-rw-r--r--src/Erebos/Network/ifaddrs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Erebos/Network/ifaddrs.c b/src/Erebos/Network/ifaddrs.c
index 70685bc..637716e 100644
--- a/src/Erebos/Network/ifaddrs.c
+++ b/src/Erebos/Network/ifaddrs.c
@@ -36,8 +36,10 @@ uint32_t * join_multicast(int fd, size_t * count)
return 0;
for (struct ifaddrs * ifa = addrs; ifa; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET6 &&
- !(ifa->ifa_flags & IFF_LOOPBACK)) {
+ if( ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET6 &&
+ ! (ifa->ifa_flags & IFF_LOOPBACK) &&
+ (ifa->ifa_flags & IFF_MULTICAST) &&
+ ! IN6_IS_ADDR_LINKLOCAL( & ((struct sockaddr_in6 *) ifa->ifa_addr)->sin6_addr ) ){
int idx = if_nametoindex(ifa->ifa_name);
bool seen = false;