PUD: nwif: make joining the multicast group on the rx socket creation work for IPv6
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 5 Jun 2012 20:42:32 +0000 (22:42 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 7 Jun 2012 22:30:04 +0000 (00:30 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/networkInterfaces.c

index 2076715..f5299b8 100644 (file)
@@ -190,7 +190,7 @@ static int createRxSocket(TRxTxNetworkInterface * networkInterface,
                struct ipv6_mreq mc6_settings;
                (void) memset(&mc6_settings, 0, sizeof(mc6_settings));
                mc6_settings.ipv6mr_multiaddr = rxMcAddr->in6.sin6_addr;
                struct ipv6_mreq mc6_settings;
                (void) memset(&mc6_settings, 0, sizeof(mc6_settings));
                mc6_settings.ipv6mr_multiaddr = rxMcAddr->in6.sin6_addr;
-               mc6_settings.ipv6mr_interface = 0;
+               mc6_settings.ipv6mr_interface = if_nametoindex((char *)networkInterface->name);
                errno = 0;
                if (setsockopt(rxSocket, ipProtoSetting, ipAddMembershipSetting,
                                &mc6_settings, sizeof(mc6_settings)) < 0) {
                errno = 0;
                if (setsockopt(rxSocket, ipProtoSetting, ipAddMembershipSetting,
                                &mc6_settings, sizeof(mc6_settings)) < 0) {