Skip to content

net:dns-sd: fix handling of mutliple questions per query #89339

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

toonst
Copy link
Contributor

@toonst toonst commented Apr 30, 2025

This fixes a bug where multiple questions inside a single DNS-SD query would not be handled correctly.
Since dns_msg was used for extracting the question, always the first question in the list would be extracted.
The extraction function is changed to use the dotted string format, so it can be called with the already extracted question.

this fixes a bug where multiple questions inside a single DNS-SD query
would not be handled correctly.

Since dns_msg was used for extracting the question, always the first
question in the list would be extracted.

The extraction function is changed to use the dotted string format, so
it can be called with the already extracted question.

Signed-off-by: Toon Stegen <toon@toostsolutions.be>
Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check the CI/compliance issues

@jukkar jukkar requested review from cfriedt and Copilot May 2, 2025 06:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request fixes a bug in handling multiple questions per DNS-SD query by switching to a dotted string extraction method. Key changes include:

  • Removing the dns_msg parameter from send_sd_response and instead using the net_buf result data.
  • Updating dns_sd_query_extract to skip a leading dot and to parse labels from a dotted string.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
subsys/net/lib/dns/mdns_responder.c Removed the dns_msg parameter and adjusted the query extraction call.
subsys/net/lib/dns/dns_sd.c Modified dns_sd_query_extract to use dotted string format and adjust label parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants