- if (b && !i->announcing) {
- avahi_log_debug("New relevant interface %s.%i (#%i)", i->hardware->name, i->protocol, i->hardware->index);
-
- if (i->protocol == AVAHI_PROTO_INET)
- avahi_mdns_mcast_join_ipv4(m->server->fd_ipv4, i->hardware->index);
- if (i->protocol == AVAHI_PROTO_INET6)
- avahi_mdns_mcast_join_ipv6(m->server->fd_ipv6, i->hardware->index);
-
- i->announcing = 1;
- avahi_announce_interface(m->server, i);
- avahi_browser_new_interface(m->server, i);
- } else if (!b && i->announcing) {
- avahi_log_debug("Interface %s.%i no longer relevant", i->hardware->name, i->protocol);
-
- if (i->protocol == AVAHI_PROTO_INET)
- avahi_mdns_mcast_leave_ipv4(m->server->fd_ipv4, i->hardware->index);
- if (i->protocol == AVAHI_PROTO_INET6)
- avahi_mdns_mcast_leave_ipv6(m->server->fd_ipv6, i->hardware->index);
+ if (!(hw = avahi_new(AvahiHwInterface, 1)))
+ return NULL;
+
+ hw->monitor = m;
+ hw->name = NULL;
+ hw->flags_ok = 0;
+ hw->mtu = 1500;
+ hw->index = idx;
+ hw->mac_address_size = 0;
+ hw->entry_group = NULL;
+
+ AVAHI_LLIST_HEAD_INIT(AvahiInterface, hw->interfaces);
+ AVAHI_LLIST_PREPEND(AvahiHwInterface, hardware, m->hw_interfaces, hw);
+
+ avahi_hashmap_insert(m->hashmap, &hw->index, hw);