Skip to content

Commit

Permalink
Merge pull request #758 from david-cermak/fix/mdns_ignore_only_invali…
Browse files Browse the repository at this point in the history
…d_queries

[mdns]: Fix the responder to ignore only invalid queries
  • Loading branch information
david-cermak authored Feb 7, 2025
2 parents 1c6580e + 64d818b commit 936e43f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/mdns/.cz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ commitizen:
bump_message: 'bump(mdns): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py mdns
tag_format: mdns-v$version
version: 1.5.2
version: 1.5.3
version_files:
- idf_component.yml
6 changes: 6 additions & 0 deletions components/mdns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [1.5.3](https://github.com/espressif/esp-protocols/commits/mdns-v1.5.3)

### Bug Fixes

- Fix responder to ignore only invalid queries ([cd07228f](https://github.com/espressif/esp-protocols/commit/cd07228f), [#754](https://github.com/espressif/esp-protocols/issues/754))

## [1.5.2](https://github.com/espressif/esp-protocols/commits/mdns-v1.5.2)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion components/mdns/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.5.2"
version: "1.5.3"
description: "Multicast UDP service used to provide local network service and host discovery."
url: "https://github.com/espressif/esp-protocols/tree/master/components/mdns"
issues: "https://github.com/espressif/esp-protocols/issues"
Expand Down
6 changes: 5 additions & 1 deletion components/mdns/mdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,11 @@ static void _mdns_create_answer_from_parsed_packet(mdns_parsed_packet_t *parsed_
shared = q->type == MDNS_TYPE_PTR || q->type == MDNS_TYPE_SDPTR || !parsed_packet->probe;
if (q->type == MDNS_TYPE_SRV || q->type == MDNS_TYPE_TXT) {
mdns_srv_item_t *service = _mdns_get_service_item_instance(q->host, q->service, q->proto, NULL);
if (service == NULL || !_mdns_create_answer_from_service(packet, service->service, q, shared, send_flush)) {
if (service == NULL) { // Service not found, but we continue to the next question
q = q->next;
continue;
}
if (!_mdns_create_answer_from_service(packet, service->service, q, shared, send_flush)) {
_mdns_free_tx_packet(packet);
return;
} else {
Expand Down

0 comments on commit 936e43f

Please sign in to comment.