Move matching logic out of service_reply_single function
[project/mdnsd.git] / dns.c
diff --git a/dns.c b/dns.c
index 7ca705e..de0c21a 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -360,8 +360,10 @@ parse_question(struct interface *iface, char *name, struct dns_question *q)
 
        switch (q->type) {
        case TYPE_ANY:
-               if (!strcmp(name, mdns_hostname_local))
+               if (!strcmp(name, mdns_hostname_local)) {
                        service_reply(iface, NULL, announce_ttl);
+                       dns_reply_a(iface, announce_ttl);
+               }
                break;
 
        case TYPE_PTR:
@@ -394,7 +396,7 @@ dns_handle_packet(struct interface *iface, struct sockaddr *s, uint16_t port, ui
        }
 
        if (h->questions && !iface->multicast && port != 5353)
-               // silently drop unicast questions that dont originate from port 5353  
+               /* silently drop unicast questions that dont originate from port 5353 */
                return;
 
        while (h->questions-- > 0) {