From: Liu Han Date: Tue, 31 Jul 2018 02:00:02 +0000 (+0800) Subject: mdns: Fix a portion of the queries are issued with the wildcard query type X-Git-Tag: v3.2-beta1~315^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3f0445f4db7c9ad97ae10a9728767337aa7bb62;p=esp-idf mdns: Fix a portion of the queries are issued with the wildcard query type --- diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 6ffebf663e..09efde9836 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -1195,7 +1195,7 @@ static void _mdns_create_answer_from_parsed_packet(mdns_parsed_packet_t * parsed } if (service) { if (q->type == MDNS_TYPE_PTR || q->type == MDNS_TYPE_ANY) { - if (q->type == MDNS_TYPE_PTR) { + if (q->type == MDNS_TYPE_PTR || !parsed_packet->probe) { shared = true; } if (!_mdns_alloc_answer(&packet->answers, MDNS_TYPE_PTR, service->service, false, false) @@ -2570,7 +2570,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet) continue; } - if (type == MDNS_TYPE_ANY) { + if (type == MDNS_TYPE_ANY && !_str_null_or_empty(name->host)) { parsed_packet->probe = true; }