From f4d1140bac274e74913bf86436370d76d6b697dd Mon Sep 17 00:00:00 2001 From: nuttxs Date: Wed, 24 Dec 2025 23:09:32 +0800 Subject: [PATCH] netutils/dhcpc.h: fix the compilation error caused by undefined CONFIG_NETDB_DNSSERVER_NAMESERVERS Provide a default value for CONFIG_NETDB_DNSSERVER_NAMESERVERS if CONFIG_NETDB_DNSCLIENT is not enabled Signed-off-by: nuttxs --- include/netutils/dhcpc.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/netutils/dhcpc.h b/include/netutils/dhcpc.h index 3529e554fe9..9f69b5dc69a 100644 --- a/include/netutils/dhcpc.h +++ b/include/netutils/dhcpc.h @@ -39,6 +39,7 @@ * Included Files ****************************************************************************/ +#include #include #include @@ -46,6 +47,14 @@ * Pre-processor Definitions ****************************************************************************/ +/* Provide a default value for CONFIG_NETDB_DNSSERVER_NAMESERVERS if + * CONFIG_NETDB_DNSCLIENT is not enabled. + */ + +#if !defined(CONFIG_NETDB_DNSSERVER_NAMESERVERS) +# define CONFIG_NETDB_DNSSERVER_NAMESERVERS 1 +#endif + /**************************************************************************** * Public Types ****************************************************************************/