diff options
author | Trent Lloyd <lathiat@bur.st> | 2005-04-25 18:48:57 +0000 |
---|---|---|
committer | Trent Lloyd <lathiat@bur.st> | 2005-04-25 18:48:57 +0000 |
commit | ba8547ee3f34d8fe7bedb559530b2c0374f2089c (patch) | |
tree | 44f022dcd715c94eaa370b74dda99cfc2aede49c /iface.c | |
parent | 4c8155fa9c85c7ece92182d0ab53f99a982a4abf (diff) |
* Import fixes to multicast code to IP_ADD_MEMBERSHIP per interface,
rather than a 'global' one, which didn't really work.
-- Trent Lloyd <lathiat@bur.st>
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@31 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'iface.c')
-rw-r--r-- | iface.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -155,6 +155,7 @@ static void new_interface(flxInterfaceMonitor *m, flxHwInterface *hw, guchar pro static void check_interface_relevant(flxInterfaceMonitor *m, flxInterface *i) { gboolean b; + g_assert(m); g_assert(i); @@ -163,13 +164,24 @@ static void check_interface_relevant(flxInterfaceMonitor *m, flxInterface *i) { if (b && !i->announcing) { g_message("New relevant interface %s.%i", i->hardware->name, i->protocol); + if (i->protocol == AF_INET) + flx_mdns_mcast_join_ipv4 (i->hardware->index, m->server->fd_ipv4); + if (i->protocol == AF_INET6) + flx_mdns_mcast_join_ipv6 (i->hardware->index, m->server->fd_ipv6); + i->announcing = TRUE; flx_announce_interface(m->server, i); } else if (!b && i->announcing) { g_message("Interface %s.%i no longer relevant", i->hardware->name, i->protocol); - i->announcing = FALSE; flx_goodbye_interface(m->server, i, FALSE); + + if (i->protocol == AF_INET) + flx_mdns_mcast_leave_ipv4 (i->hardware->index, m->server->fd_ipv4); + if (i->protocol == AF_INET6) + flx_mdns_mcast_leave_ipv6 (i->hardware->index, m->server->fd_ipv6); + + i->announcing = FALSE; } } |