From 6ddb505f6816e081a8edf7ac854bd791faf67666 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 6 Aug 2015 16:07:07 +0200 Subject: [PATCH] minissdpd: disable multicast loop --- minissdpd/Changelog.txt | 5 ++++- minissdpd/openssdpsocket.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/minissdpd/Changelog.txt b/minissdpd/Changelog.txt index cd53c27..1cf6e51 100644 --- a/minissdpd/Changelog.txt +++ b/minissdpd/Changelog.txt @@ -1,4 +1,7 @@ -$Id: Changelog.txt,v 1.42 2015/08/06 13:16:58 nanard Exp $ +$Id: Changelog.txt,v 1.43 2015/08/06 14:05:49 nanard Exp $ + +2015/08/06: + disable multicast loop VERSION 1.4: diff --git a/minissdpd/openssdpsocket.c b/minissdpd/openssdpsocket.c index 0fe2162..b525e27 100644 --- a/minissdpd/openssdpsocket.c +++ b/minissdpd/openssdpsocket.c @@ -1,4 +1,4 @@ -/* $Id: openssdpsocket.c,v 1.16 2015/07/21 15:39:37 nanard Exp $ */ +/* $Id: openssdpsocket.c,v 1.17 2015/08/06 14:05:37 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006-2015 Thomas Bernard @@ -106,6 +106,7 @@ OpenAndConfSSDPReceiveSocket(int ipv6, unsigned char ttl) { int s; int opt = 1; + unsigned char loopchar = 0; #ifdef ENABLE_IPV6 struct sockaddr_storage sockname; #else /* ENABLE_IPV6 */ @@ -196,6 +197,11 @@ OpenAndConfSSDPReceiveSocket(int ipv6, unsigned char ttl) sockname_len = sizeof(struct sockaddr_in); #endif /* ENABLE_IPV6 */ + if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&loopchar, sizeof(loopchar)) < 0) + { + syslog(LOG_WARNING, "setsockopt(IP_MULTICAST_LOOP): %m"); + } + if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0) { syslog(LOG_WARNING, "setsockopt(IP_MULTICAST_TTL): %m");