#include <libubox/uloop.h>
#include <libubox/avl-cmp.h>
#include <libubox/utils.h>
+#include "cache.h"
#include "interface.h"
#include "util.h"
#include "dns.h"
{
if (!iface->multicast && !to) {
fprintf(stderr, "No IP address specified for unicast interface\n");
+ errno = EINVAL;
return -1;
}
static void interface_free(struct interface *iface)
{
+ uloop_timeout_cancel(&iface->reconnect);
interface_close(iface);
free(iface);
}
uloop_fd_add(&iface->fd, ULOOP_READ);
if (iface->multicast) {
- dns_send_question(iface, "_services._dns-sd._udp.local", TYPE_PTR, 0);
+ dns_send_question(iface, C_DNS_SD, TYPE_PTR, 0);
announce_init(iface);
}
uloop_fd_add(&iface->fd, ULOOP_READ);
if (iface->multicast) {
- dns_send_question(iface, "_services._dns-sd._udp.local", TYPE_PTR, 0);
+ dns_send_question(iface, C_DNS_SD, TYPE_PTR, 0);
announce_init(iface);
}
if (node_old) {
iface = container_of(node_old, struct interface, node);
+ cache_cleanup(iface);
interface_free(iface);
}