When a question is incoming the service was incorrectly resettig the
query timeout regardless of it being the right service. This causes
the code to never answer the questions it is being asked.
Reported-by: Cristian Morales Vega <cristian@samknows.com>
Signed-off-by: John Crispin <john@phrozen.org>
service_timeout(struct service *s)
{
time_t t = monotonic_time();
service_timeout(struct service *s)
{
time_t t = monotonic_time();
if (t - s->t <= TOUT_LOOKUP)
return 0;
if (t - s->t <= TOUT_LOOKUP)
return 0;
- s->t = t;
-
- return 1;
{
const char *host = service_name(s->service);
char *service = strstr(host, "._");
{
const char *host = service_name(s->service);
char *service = strstr(host, "._");
+ time_t t = service_timeout(s);
+
- if (!force && (!s->active || !service || !service_timeout(s)))
+ if (!force && (!s->active || !service || !t))
if (match && strcmp(match, s->service))
return;
if (match && strcmp(match, s->service))
return;
dns_init_answer();
service_add_ptr(service_name(s->service), ttl);
dns_send_answer(iface, service);
dns_init_answer();
service_add_ptr(service_name(s->service), ttl);
dns_send_answer(iface, service);