FreeRTOS-Plus-TCP icon indicating copy to clipboard operation
FreeRTOS-Plus-TCP copied to clipboard

Set MDNS AA bit while answering MDNS request.

Open ActoryOu opened this issue 1 year ago • 0 comments

Set MDNS AA bit while answering MDNS request.

Description

From forum question FreeRTOS+TCP mDNS behaviour on receiving request, the AA bit of MDNS reply is not set correctly.

Here is the description in RFC6762 18.4.

In response messages for Multicast domains, the Authoritative Answer bit MUST be set to one (not setting this bit would imply there’s some other place where “better” information may be found) and MUST be ignored on reception.

So in this PR, we add the AA bit for MDNS query. And keep the behavior unchanged for LLMNR query.

Test Steps

  1. Add unit test to parse MDNS request.
  2. Check the flag in the DNS header to see if it's 0x8400. (with QR bit and AA bit set)

Checklist:

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

Related Issue

https://forums.freertos.org/t/freertos-tcp-mdns-behaviour-on-receiving-request/22455

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

ActoryOu avatar Feb 04 '25 07:02 ActoryOu