Skip to content

Commit b910316

Browse files
committed
fix(mdns): distinguish subtype queries from instances
1 parent d358297 commit b910316

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

components/mdns/mdns_receive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ static void mdns_parse_packet(mdns_rx_packet_t *packet)
734734
continue;
735735
}
736736

737-
if (type == MDNS_TYPE_ANY && !mdns_utils_str_null_or_empty(name->host)) {
737+
if (type == MDNS_TYPE_ANY && !name->sub && !mdns_utils_str_null_or_empty(name->host)) {
738738
parsed_packet->probe = true;
739739
}
740740

components/mdns/mdns_send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static bool create_answer_from_service(mdns_tx_packet_t *packet, mdns_service_t
257257
{
258258
mdns_host_item_t *host = get_host_item(service->hostname);
259259
bool is_delegated = (host != mdns_priv_get_self_host());
260-
bool is_instance_question = !mdns_utils_str_null_or_empty(question->host);
260+
bool is_instance_question = !question->sub && !mdns_utils_str_null_or_empty(question->host);
261261
if ((question->type == MDNS_TYPE_ANY) && is_instance_question) {
262262
// Instance-scoped ANY queries expect the resolved data (SRV/TXT) to be
263263
// part of the answer section so that queriers can stop searching as soon

0 commit comments

Comments
 (0)