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>
{
struct ip_mreqn mreq;
uint8_t ttl = 255;
{
struct ip_mreqn mreq;
uint8_t ttl = 255;
struct sockaddr_in sa = { 0 };
int fd = iface->fd.fd;
struct sockaddr_in sa = { 0 };
int fd = iface->fd.fd;
- 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;
fprintf(stderr, "ioctl failed: IP_MULTICAST_LOOP\n");
return 0;
{
struct ipv6_mreq mreq;
int ttl = 255;
{
struct ipv6_mreq mreq;
int ttl = 255;
struct sockaddr_in6 sa = { 0 };
int fd = iface->fd.fd;
struct sockaddr_in6 sa = { 0 };
int fd = iface->fd.fd;
- 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;
fprintf(stderr, "ioctl failed: IPV6_MULTICAST_LOOP\n");
return 0;