Skip to content

Conversation

htibosch
Copy link
Contributor

Description

Both mDNS and LLMNR work fine, except whan it receives a request from a Linux machine: we found that an mDNS server must set the authoritative flag, and also that it shall not repeat the Questions from the requester.
Other OSs like Windows are more forgiving.

  1. Set a new variable xSet.uxSkipCount as soon as the full name in Questions has been parsed. Why: because the Questions section will become the Answers section, containing:

    Name: 'full_name.local', Type A, Class IN, TTL, Addr length, Address.
    Or the name followed by 16 or 28 bytes.

  2. When replying to an mDNS request, do not include the Questions section: 'xSet.usQuestions' will become zero.

  3. With thanks to @ActoryOu : mDNS sets the authoritative flag when replying. See PR Set MDNS AA bit while answering MDNS request. #1223

  4. Do not handle type A when IPv4 is not enabled
    Do not handle type AAAA when IPv6 is not enabled

  5. Make sure that 'pxNewBuffer' will be released just before exiting the function DNS_ParseDNSReply()

Test Steps

I tested while enabling either ipconfigUSE_MDNS or ipconfigUSE_LLMNR. The former replies with an Answers section only, the latter repeats the questions and then sends the Answers.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@htibosch
Copy link
Contributor Author

/bot run formatting

@moninom1
Copy link
Member

/bot run formatting

@moninom1
Copy link
Member

@htibosch Seems like UTs are also failing, can you please help in checking on that. Thanks

@bjsowa
Copy link
Contributor

bjsowa commented Oct 14, 2025

@htibosch I tried your changes and it fixed mDNS for me. I found, however, two small issues that still persist:

  1. When IPv4 endpoint receives AAAA question, it answers with empty IP (::)
  2. When a single query contains two or more questions (for example one A and one AAAA type), FreeRTOS+TCP will only answer the last one.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants