]> git.meshlink.io Git - catta/commitdiff
* fix bug where avahi-daemon wasn't working anymore after the iface went down/up
authorSebastien Estienne <sebastien.estienne@gmail.com>
Fri, 10 Feb 2006 01:34:45 +0000 (01:34 +0000)
committerSebastien Estienne <sebastien.estienne@gmail.com>
Fri, 10 Feb 2006 01:34:45 +0000 (01:34 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1131 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/socket.c

index 184fa1b9dbf088fd0e739b5d16747fc61c1d1ba1..444be6e5f81e91449b6219b3c57916faf17fa31c 100644 (file)
@@ -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;