summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Birger2016-05-22 09:20:43 +0000
committerJohn Crispin2016-05-23 07:26:42 +0000
commit8a70b2b47dd328f8180e5ecaa7bdc817f574a81b (patch)
treea0bf2d2625122ac04e4efea73105da14600f8b78
parentae8773477c31b741ba8b47f8898e4c0a1c834b85 (diff)
downloadmdnsd-8a70b2b47dd328f8180e5ecaa7bdc817f574a81b.tar.gz
mdnsd: interface: enable looped back messages
When the IP_MULTICAST_LOOP/IPV6_MULTICAST_LOOP socket options are not enabled, locally generated queries are ignored by mdnsd; This prevents local applications from being able to discover locally published services. Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
-rw-r--r--interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/interface.c b/interface.c
index c8d8972..9ca85e1 100644
--- a/interface.c
+++ b/interface.c
@@ -315,7 +315,7 @@ interface_mcast_setup4(struct interface *iface)
{
struct ip_mreqn mreq;
uint8_t ttl = 255;
- int no = 0;
+ int yes = 1;
struct sockaddr_in sa = { 0 };
int fd = iface->fd.fd;
@@ -345,7 +345,7 @@ interface_mcast_setup4(struct interface *iface)
return -1;
}
- if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &no, sizeof(no)) < 0)
+ if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &yes, sizeof(yes)) < 0)
fprintf(stderr, "ioctl failed: IP_MULTICAST_LOOP\n");
return 0;
@@ -356,7 +356,7 @@ interface_socket_setup6(struct interface *iface)
{
struct ipv6_mreq mreq;
int ttl = 255;
- int no = 0;
+ int yes = 1;
struct sockaddr_in6 sa = { 0 };
int fd = iface->fd.fd;
@@ -379,7 +379,7 @@ interface_socket_setup6(struct interface *iface)
return -1;
}
- if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &no, sizeof(no)) < 0)
+ if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &yes, sizeof(yes)) < 0)
fprintf(stderr, "ioctl failed: IPV6_MULTICAST_LOOP\n");
return 0;