Skip to content

Commit adc3430

Browse files
mdns: Add MDNS_STRICT_MODE config option
Strict mode was hardcoded in private header file, but it's useful for users to enable/disable it depending on the mdns library they are using. e.g. Avahi might not resolve the non-strict answers. * Original commit: espressif/esp-idf@0eee315
1 parent 7a8329c commit adc3430

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

components/mdns/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ menu "mDNS"
5656
Configures timeout for adding a new mDNS service. Adding a service
5757
fails if could not be completed within this time.
5858

59+
config MDNS_STRICT_MODE
60+
bool "mDNS strict mode"
61+
default "n"
62+
help
63+
Configures strict mode. Set this to 1 for the mDNS library to strictly follow the RFC6762:
64+
Currently the only strict feature: Do not repeat original questions in response packets
65+
(defined in RFC6762 sec. 6).
66+
Default configuration is 0, i.e. non-strict mode, since some implementations,
67+
such as lwIP mdns resolver (used by standard POSIX API like getaddrinfo, gethostbyname)
68+
could not correctly resolve advertised names.
69+
5970
config MDNS_TIMER_PERIOD_MS
6071
int "mDNS timer period (ms)"
6172
range 10 10000

components/mdns/private_include/mdns_private.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
* such as lwIP mdns resolver (used by standard POSIX API like getaddrinfo, gethostbyname)
3333
* could not correctly resolve advertised names.
3434
*/
35+
#ifndef CONFIG_MDNS_STRICT_MODE
3536
#define MDNS_STRICT_MODE 0
37+
#else
38+
#define MDNS_STRICT_MODE 1
39+
#endif
3640

3741
#if !MDNS_STRICT_MODE
3842
/* mDNS responders sometimes repeat queries in responses

0 commit comments

Comments
 (0)