From 0a9b02c1014c8bf96d272d132403a16f98615d2e Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Fri, 10 Feb 2006 01:34:45 +0000 Subject: [PATCH] * fix bug where avahi-daemon wasn't working anymore after the iface went down/up git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1131 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/avahi-core/socket.c b/avahi-core/socket.c index 184fa1b..444be6e 100644 --- a/avahi-core/socket.c +++ b/avahi-core/socket.c @@ -125,6 +125,9 @@ int avahi_mdns_mcast_join_ipv4(int fd, const AvahiIPv4Address *a, int idx, int j mdns_mcast_group_ipv4(&sa); mreq.imr_multiaddr = sa.sin_addr; + if (join) + setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); + if (setsockopt(fd, IPPROTO_IP, join ? IP_ADD_MEMBERSHIP : IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) { avahi_log_warn("%s failed: %s", join ? "IP_ADD_MEMBERSHIP" : "IP_DROP_MEMBERSHIP", strerror(errno)); return -1; -- 2.39.5