Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: dns: Answers to multiple mDNS queries sent in parallel aren't properly handled #21914

Closed
lbise opened this issue Jan 14, 2020 · 2 comments · Fixed by #21952
Closed

net: dns: Answers to multiple mDNS queries sent in parallel aren't properly handled #21914

lbise opened this issue Jan 14, 2020 · 2 comments · Fixed by #21952
Assignees
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@lbise
Copy link
Contributor

lbise commented Jan 14, 2020

When trying to resolve several different mDNS names at the same time, the answers received for each queries aren't always properly matched to the initial query.

This is because mDNS queries always have an ID of 0, so when receiving an answer in dns_read, the query slot returned will always be the first of the list since all IDs are at 0:

*dns_id = dns_unpack_header_id(dns_msg.msg);

RFC 6762 says:

In multicast responses, including unsolicited multicast responses, the Query Identifier MUST be set to zero on transmission, and MUST be ignored on reception.

Another way to match the answer to the query must be used for mDNS queries.

@lbise lbise added the bug The issue is a bug, or the PR is fixing a bug label Jan 14, 2020
@jukkar jukkar added the priority: low Low impact/importance bug label Jan 14, 2020
@jukkar
Copy link
Member

jukkar commented Jan 15, 2020

@lbise fix proposal at #21952. I tested it and everything seems to work ok but it would be great if you could verify that it works now as expected.

@lbise
Copy link
Contributor Author

lbise commented Jan 16, 2020

@lbise fix proposal at #21952. I tested it and everything seems to work ok but it would be great if you could verify that it works now as expected.

Thanks for the speedy fix jukkar. This particular issue is now fixed. I have opened another issue for another problem if you could take a look, I think the fix is trivial. #21970

jukkar added a commit to jukkar/zephyr that referenced this issue Jan 17, 2020
As mDNS requests set DNS id to 0, we cannot use it to match
the DNS response packet. In order to allow this functionality,
create a hash from query name and type, and use that together
with DNS id to match request and response.

Fixes zephyrproject-rtos#21914

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
jukkar added a commit that referenced this issue Jan 24, 2020
As mDNS requests set DNS id to 0, we cannot use it to match
the DNS response packet. In order to allow this functionality,
create a hash from query name and type, and use that together
with DNS id to match request and response.

Fixes #21914

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants