From d024b037d70d88e7f21aa02668811bb5a8ac717e Mon Sep 17 00:00:00 2001 From: Ricard Rosson Date: Sat, 11 Jul 2026 06:17:53 +0100 Subject: [PATCH] netutils/mdns: raise responder stack size default to 8KiB CONFIG_NETUTILS_MDNS_STACKSIZE defaulted to DEFAULT_TASK_STACKSIZE, which resolves to as little as 2KiB on some targets. The bundled mjansson responder uses a deeper stack than that (DNS record parsing with name decompression, plus the send/receive buffers) and overflows on startup, taking the board down with a hardfault before it answers a single query. Default to 8KiB, the value that reliably runs the responder, and correct the help text, which previously claimed a 4KiB default that did not match DEFAULT_TASK_STACKSIZE. Co-Authored-By: Claude Opus 4.8 Signed-off-by: Ricard Rosson --- netutils/mdns/Kconfig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/netutils/mdns/Kconfig b/netutils/mdns/Kconfig index bd2003bdbed..19042ea3fee 100644 --- a/netutils/mdns/Kconfig +++ b/netutils/mdns/Kconfig @@ -51,11 +51,15 @@ config NETUTILS_MDNS_PRIORITY config NETUTILS_MDNS_STACKSIZE int "mDNS stack size" - default DEFAULT_TASK_STACKSIZE + default 8192 ---help--- - The default (4KiB) is adequate for simple networks but this will - most likely need to be increased if there are many network devices - attached that could send queries. + Stack size for the mDNS responder task. The bundled mjansson + responder uses a fairly deep stack (record parsing with name + decompression plus the send/receive buffers), so the previous + default of DEFAULT_TASK_STACKSIZE overflows and hardfaults on + startup on targets where that resolves to a small value (e.g. + 2KiB). 8KiB is adequate for typical networks; increase it further + if many devices on the network send queries. config NETUTILS_MDNS_VERBOSE bool "Enable verbose printf output from built-in mdns demo"