env: Fix network support when CONFIG_NET_LWIP is set

When lwIP (CONFIG_NET_LWIP) is used instead of legacy stack (CONFIG_NET),
environment flags support associated with network was not built: restore
support of "i" and "m" environment flags.

Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Benjamin ROBIN
2025-05-17 22:09:30 +02:00
committed by Tom Rini
parent 93905ab6e7
commit 6aa9c0f453
3 changed files with 9 additions and 9 deletions

10
env/flags.c vendored
View File

@@ -22,7 +22,7 @@
#include <env_internal.h> #include <env_internal.h>
#endif #endif
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
#define ENV_FLAGS_NET_VARTYPE_REPS "im" #define ENV_FLAGS_NET_VARTYPE_REPS "im"
#else #else
#define ENV_FLAGS_NET_VARTYPE_REPS "" #define ENV_FLAGS_NET_VARTYPE_REPS ""
@@ -57,7 +57,7 @@ static const char * const env_flags_vartype_names[] = {
"decimal", "decimal",
"hexadecimal", "hexadecimal",
"boolean", "boolean",
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
"IP address", "IP address",
"MAC address", "MAC address",
#endif #endif
@@ -211,7 +211,7 @@ static void skip_num(int hex, const char *value, const char **end,
*end = value; *end = value;
} }
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
int eth_validate_ethaddr_str(const char *addr) int eth_validate_ethaddr_str(const char *addr)
{ {
const char *end; const char *end;
@@ -244,7 +244,7 @@ static int _env_flags_validate_type(const char *value,
enum env_flags_vartype type) enum env_flags_vartype type)
{ {
const char *end; const char *end;
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
const char *cur; const char *cur;
int i; int i;
#endif #endif
@@ -273,7 +273,7 @@ static int _env_flags_validate_type(const char *value,
if (value[1] != '\0') if (value[1] != '\0')
return -1; return -1;
break; break;
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
case env_flags_vartype_ipaddr: case env_flags_vartype_ipaddr:
cur = value; cur = value;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {

View File

@@ -32,7 +32,7 @@
#define DNS_CALLBACK #define DNS_CALLBACK
#endif #endif
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
#define NET_CALLBACKS \ #define NET_CALLBACKS \
"bootfile:bootfile," \ "bootfile:bootfile," \
"ipaddr:ipaddr," \ "ipaddr:ipaddr," \

View File

@@ -14,7 +14,7 @@ enum env_flags_vartype {
env_flags_vartype_decimal, env_flags_vartype_decimal,
env_flags_vartype_hex, env_flags_vartype_hex,
env_flags_vartype_bool, env_flags_vartype_bool,
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
env_flags_vartype_ipaddr, env_flags_vartype_ipaddr,
env_flags_vartype_macaddr, env_flags_vartype_macaddr,
#endif #endif
@@ -41,7 +41,7 @@ enum env_flags_varaccess {
#define CFG_ENV_FLAGS_LIST_STATIC "" #define CFG_ENV_FLAGS_LIST_STATIC ""
#endif #endif
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
#ifdef CONFIG_REGEX #ifdef CONFIG_REGEX
#define ETHADDR_WILDCARD "\\d*" #define ETHADDR_WILDCARD "\\d*"
#else #else
@@ -123,7 +123,7 @@ enum env_flags_varaccess env_flags_parse_varaccess(const char *flags);
*/ */
enum env_flags_varaccess env_flags_parse_varaccess_from_binflags(int binflags); enum env_flags_varaccess env_flags_parse_varaccess_from_binflags(int binflags);
#ifdef CONFIG_NET #if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
/* /*
* Check if a string has the format of an Ethernet MAC address * Check if a string has the format of an Ethernet MAC address
*/ */