From 4f4640b1df62f353d6eb59f309bbadcc5adbf3bd Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 19 Feb 2021 16:44:08 +0100 Subject: [PATCH] mdns: Fix parsing answers with questions when instance name not set mdns resolver didn't correctly resolved queries when host name wasn't assigned. Fixed by allowing processing also if some answer present (non-strict mode) Closes https://github.com/espressif/esp-idf/issues/6598 --- components/mdns/mdns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 782dc6d2a8..1436072abe 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -2665,7 +2665,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet) } //if we have not set the hostname, we can not answer questions - if (header.questions && _str_null_or_empty(_mdns_server->hostname)) { + if (header.questions && !header.answers && _str_null_or_empty(_mdns_server->hostname)) { free(parsed_packet); return; }