}
static void
-service_reply_single(struct interface *iface, struct service *s, const char *match, int ttl, int force)
+service_reply_single(struct interface *iface, struct service *s, int ttl, int force)
{
const char *host = service_name(s->service);
char *service = strstr(host, "._");
service++;
- if (match && strcmp(match, s->service))
- return;
-
s->t = t;
dns_init_answer();
{
struct service *s;
- vlist_for_each_element(&services, s, node)
- service_reply_single(iface, s, match, ttl, 0);
+ vlist_for_each_element(&services, s, node) {
+ if (!match || !strcmp(s->service, match))
+ service_reply_single(iface, s, ttl, 0);
+ }
}
void
if (service_init_announce)
vlist_for_each_element(&interfaces, iface, node) {
s->t = 0;
- service_reply_single(iface, s, NULL, announce_ttl, 1);
+ service_reply_single(iface, s, announce_ttl, 1);
}
return;
}
s = container_of(node_old, struct service, node);
if (!node_new && service_init_announce)
vlist_for_each_element(&interfaces, iface, node)
- service_reply_single(iface, s, NULL, 0, 1);
+ service_reply_single(iface, s, 0, 1);
free(s);
}