From 28cd898eca5212a439fb279d7a9860e5308fd71e Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Fri, 14 Jul 2023 17:50:34 +0800 Subject: [PATCH] feat(mdns): Allow setting length of mDNS action queue in menuconfig --- components/mdns/Kconfig | 7 +++++++ components/mdns/private_include/mdns_private.h | 2 +- components/mdns/tests/test_afl_fuzz_host/sdkconfig.h | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components/mdns/Kconfig b/components/mdns/Kconfig index 53fb79ee5..d19315b9f 100644 --- a/components/mdns/Kconfig +++ b/components/mdns/Kconfig @@ -27,6 +27,13 @@ menu "mDNS" higher than priorities of system tasks. Compile time warning/error would be emitted if the chosen task priority were too high. + config MDNS_ACTION_QUEUE_LEN + int "Maximum actions pending to the server" + range 8 64 + default 16 + help + Allows setting the length of mDNS action queue. + config MDNS_TASK_STACK_SIZE int "mDNS task stack size" default 4096 diff --git a/components/mdns/private_include/mdns_private.h b/components/mdns/private_include/mdns_private.h index 9289e4449..939a06329 100644 --- a/components/mdns/private_include/mdns_private.h +++ b/components/mdns/private_include/mdns_private.h @@ -93,7 +93,7 @@ #define MDNS_SERVICE_ADD_TIMEOUT_MS CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS #define MDNS_PACKET_QUEUE_LEN 16 // Maximum packets that can be queued for parsing -#define MDNS_ACTION_QUEUE_LEN 16 // Maximum actions pending to the server +#define MDNS_ACTION_QUEUE_LEN CONFIG_MDNS_ACTION_QUEUE_LEN // Maximum actions pending to the server #define MDNS_TXT_MAX_LEN 1024 // Maximum string length of text data in TXT record #if defined(CONFIG_LWIP_IPV6) && defined(CONFIG_MDNS_RESPOND_REVERSE_QUERIES) #define MDNS_NAME_MAX_LEN (64+4) // Need to account for IPv6 reverse queries (64 char address + ".ip6" ) diff --git a/components/mdns/tests/test_afl_fuzz_host/sdkconfig.h b/components/mdns/tests/test_afl_fuzz_host/sdkconfig.h index c5fb91460..59068794f 100644 --- a/components/mdns/tests/test_afl_fuzz_host/sdkconfig.h +++ b/components/mdns/tests/test_afl_fuzz_host/sdkconfig.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -290,6 +290,7 @@ #define CONFIG_MDNS_MAX_SERVICES 25 #define CONFIG_MDNS_MAX_INTERFACES 3 #define CONFIG_MDNS_TASK_PRIORITY 1 +#define CONFIG_MDNS_ACTION_QUEUE_LEN 16 #define CONFIG_MDNS_TASK_STACK_SIZE 4096 #define CONFIG_MDNS_TASK_AFFINITY_CPU0 1 #define CONFIG_MDNS_TASK_AFFINITY 0x0