From c4c2f79c125efd870b535fcbbee3822f2f9d1abc Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 22 May 2014 10:22:04 +0200 Subject: [PATCH] miniupnpd/minissdp.c: Add IPV6 multicast membership only on selected "LAN" interfaces --- miniupnpd/Changelog.txt | 1 + miniupnpd/minissdp.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index 967ad43..ed60cc5 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -3,6 +3,7 @@ $Id: Changelog.txt,v 1.374 2014/05/22 07:56:32 nanard Exp $ 2014/05/22: Add ipv6_bind_address (option "ipv6_listening_ip") disable IPv6 when socket(PF_INTET6, ...) errors with EAFNOSUPPORT + Add IPV6 multicast membership only on selected "LAN" interfaces 2014/05/20: be more strict when parsing LAN addresses / interface names diff --git a/miniupnpd/minissdp.c b/miniupnpd/minissdp.c index fcf046d..f9f4380 100644 --- a/miniupnpd/minissdp.c +++ b/miniupnpd/minissdp.c @@ -165,10 +165,14 @@ OpenAndConfSSDPReceiveSocket(int ipv6) #ifdef ENABLE_IPV6 if(ipv6) { - if(AddMulticastMembershipIPv6(s, 0) < 0) + for(lan_addr = lan_addrs.lh_first; lan_addr != NULL; lan_addr = lan_addr->list.le_next) { - syslog(LOG_WARNING, - "Failed to add IPv6 multicast membership"); + if(AddMulticastMembershipIPv6(s, lan_addr->index) < 0) + { + syslog(LOG_WARNING, + "Failed to add IPv6 multicast membership for interface %s", + lan_addr->str ? lan_addr->str : "NULL"); + } } } else