mdns: fix mdns server instance mismatch

* Original commit: espressif/esp-idf@6173dd7809
This commit is contained in:
zhangwenxu authored and suren-gabrielyan-espressif committed 2022-05-27 17:44:24 +04:00
1 parent 69902ea8e1
commit f0839d909b
1 file changed
+8 -2
+8 -2
View File
@@ -293,8 +293,14 @@ static mdns_srv_item_t *_mdns_get_service_item_instance(const char *instance, co
{
mdns_srv_item_t *s = _mdns_server->services;
while (s) {
if (_mdns_service_match_instance(s->service, instance, service, proto, hostname)) {
return s;
if (instance) {
if (_mdns_service_match_instance(s->service, instance, service, proto, hostname)) {
return s;
}
} else {
if (_mdns_service_match(s->service, service, proto, hostname)) {
return s;
}
}
s = s->next;
}