case STATE_PROBE1:
case STATE_PROBE2:
case STATE_PROBE3:
- dns_send_question(iface, mdns_hostname_local, TYPE_ANY, 0);
+ dns_send_question(iface, mdns_hostname_local, TYPE_ANY, 1);
uloop_timeout_set(timeout, 250);
iface->announce_state++;
break;
continue;
}
s->refresh += 50;
- dns_send_question(s->iface, s->entry, TYPE_PTR, 1);
+ dns_send_question(s->iface, s->entry, TYPE_PTR, 0);
}
uloop_timeout_set(timeout, 10000);
vlist_for_each_element(&interfaces, iface, node)
avl_for_each_element(&services, s, avl)
- dns_send_question(iface, s->entry, TYPE_PTR, 1);
+ dns_send_question(iface, s->entry, TYPE_PTR, 0);
}
static struct cache_service*
avl_insert(&services, &s->avl);
if (!hlen)
- dns_send_question(iface, entry, TYPE_PTR, !iface->multicast);
+ dns_send_question(iface, entry, TYPE_PTR, iface->multicast);
return s;
}
}
void
-dns_send_question(struct interface *iface, const char *question, int type, int unicast)
+dns_send_question(struct interface *iface, const char *question, int type, int multicast)
{
static struct dns_header h;
static struct dns_question q;
int len;
h.questions = cpu_to_be16(1);
- q.class = cpu_to_be16(((unicast) ? (CLASS_UNICAST) : (0)) | 1);
+ q.class = cpu_to_be16((multicast ? 0 : CLASS_UNICAST) | 1);
q.type = cpu_to_be16(type);
len = dn_comp(question, (void *) dns_buffer, sizeof(dns_buffer), NULL, NULL);
extern int cfg_proto;
extern int cfg_no_subnet;
-void dns_send_question(struct interface *iface, const char *question, int type, int unicast);
+void dns_send_question(struct interface *iface, const char *question, int type, int multicast);
void dns_init_answer(void);
void dns_add_answer(int type, const uint8_t *rdata, uint16_t rdlength, int ttl);
void dns_send_answer(struct interface *iface, const char *answer);
uloop_fd_add(&iface->fd, ULOOP_READ);
if (iface->multicast) {
- dns_send_question(iface, "_services._dns-sd._udp.local", TYPE_PTR, 1);
+ dns_send_question(iface, "_services._dns-sd._udp.local", 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, 1);
+ dns_send_question(iface, "_services._dns-sd._udp.local", TYPE_PTR, 0);
announce_init(iface);
}
if (!strcmp(method, "query")) {
if (iface_v4)
- dns_send_question(iface_v4, question, type, 0);
+ dns_send_question(iface_v4, question, type, 1);
if (iface_v6)
- dns_send_question(iface_v6, question, type, 0);
+ dns_send_question(iface_v6, question, type, 1);
return UBUS_STATUS_OK;
} else if (!strcmp(method, "fetch")) {