mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-29 02:07:27 +02:00
mdns: Fix parsing non-standard queries
Fix for packets containing unexpected domains, such as openthread.thread.home.arpa. If we find this packet we set the name entry as invalid, but continue with parsing as the packet might contain related queries for us. Closes https://github.com/espressif/esp-idf/issues/7694 * Original commit: espressif/esp-idf@d16f9bade5
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
eb7eeb58d3
commit
38b4fe2353
@ -310,6 +310,7 @@ static const uint8_t * _mdns_read_fqdn(const uint8_t * packet, const uint8_t * s
|
||||
buf[len] = '\0';
|
||||
if (name->parts == 1 && buf[0] != '_'
|
||||
&& (strcasecmp(buf, MDNS_DEFAULT_DOMAIN) != 0)
|
||||
&& (strcasecmp(buf, "arpa") != 0)
|
||||
&& (strcasecmp(buf, "ip6") != 0)
|
||||
&& (strcasecmp(buf, "in-addr") != 0)) {
|
||||
strlcat(name->host, ".", sizeof(name->host));
|
||||
@ -2793,7 +2794,8 @@ static const uint8_t * _mdns_parse_fqdn(const uint8_t * packet, const uint8_t *
|
||||
if (strcasecmp(name->domain, MDNS_DEFAULT_DOMAIN) == 0 || strcasecmp(name->domain, "arpa") == 0) {
|
||||
return next_data;
|
||||
}
|
||||
return 0;
|
||||
name->invalid = true; // mark the current name invalid, but continue with other question
|
||||
return next_data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user