Skip to content

Commit

Permalink
Merge branch 'bugfix/mdns_non_standard_domains' into 'master'
Browse files Browse the repository at this point in the history
mdns: Fix parsing non-standard queries

Closes IDFGH-6009

See merge request espressif/esp-idf!15566
  • Loading branch information
david-cermak committed Oct 20, 2021
2 parents f06bc44 + d16f9ba commit 4e03a9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/mdns/mdns.c
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 4e03a9c

Please sign in to comment.