diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2006-02-10 01:34:45 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2006-02-10 01:34:45 +0000 |
commit | 0a9b02c1014c8bf96d272d132403a16f98615d2e (patch) | |
tree | 416e1315bc28c1622bdac1a5176e4aea1a7b3171 /avahi-core | |
parent | 7ba2b1fcc731085127c9976b1bae4aaaa5b8b7a7 (diff) |
* 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
Diffstat (limited to 'avahi-core')
-rw-r--r-- | avahi-core/socket.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |