mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-25 16:27:29 +02:00
mdns: filter instance name for ANY queries
The instance name in ANY quries was ignored. The MR fixes the issue. * Original commit: espressif/esp-idf@5d0c47303d
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
ae381b779f
commit
7e82a7cef7
@ -1540,6 +1540,8 @@ static bool _mdns_service_match_ptr_question(const mdns_service_t *service, cons
|
|||||||
if (!_mdns_service_match(service, question->service, question->proto, NULL)) {
|
if (!_mdns_service_match(service, question->service, question->proto, NULL)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// The question parser stores anything before _type._proto in question->host
|
||||||
|
// So the question->host can be subtype or instance name based on its content
|
||||||
if (question->sub) {
|
if (question->sub) {
|
||||||
mdns_subtype_t *subtype = service->subtype;
|
mdns_subtype_t *subtype = service->subtype;
|
||||||
while (subtype) {
|
while (subtype) {
|
||||||
@ -1550,6 +1552,11 @@ static bool _mdns_service_match_ptr_question(const mdns_service_t *service, cons
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (question->host) {
|
||||||
|
if (strcasecmp(service->instance, question->host) != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user