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>
diff --git a/env/flags.c b/env/flags.c
index 233fd46..f734fda 100644
--- a/env/flags.c
+++ b/env/flags.c
@@ -22,7 +22,7 @@
#include <env_internal.h>
#endif
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
#define ENV_FLAGS_NET_VARTYPE_REPS "im"
#else
#define ENV_FLAGS_NET_VARTYPE_REPS ""
@@ -57,7 +57,7 @@
"decimal",
"hexadecimal",
"boolean",
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
"IP address",
"MAC address",
#endif
@@ -211,7 +211,7 @@
*end = value;
}
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
int eth_validate_ethaddr_str(const char *addr)
{
const char *end;
@@ -244,7 +244,7 @@
enum env_flags_vartype type)
{
const char *end;
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
const char *cur;
int i;
#endif
@@ -273,7 +273,7 @@
if (value[1] != '\0')
return -1;
break;
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
case env_flags_vartype_ipaddr:
cur = value;
for (i = 0; i < 4; i++) {
diff --git a/include/env_callback.h b/include/env_callback.h
index 47a31f6..918ccb3 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -32,7 +32,7 @@
#define DNS_CALLBACK
#endif
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
#define NET_CALLBACKS \
"bootfile:bootfile," \
"ipaddr:ipaddr," \
diff --git a/include/env_flags.h b/include/env_flags.h
index 2476043..92c7ea8 100644
--- a/include/env_flags.h
+++ b/include/env_flags.h
@@ -14,7 +14,7 @@
env_flags_vartype_decimal,
env_flags_vartype_hex,
env_flags_vartype_bool,
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
env_flags_vartype_ipaddr,
env_flags_vartype_macaddr,
#endif
@@ -41,7 +41,7 @@
#define CFG_ENV_FLAGS_LIST_STATIC ""
#endif
-#ifdef CONFIG_NET
+#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
#ifdef CONFIG_REGEX
#define ETHADDR_WILDCARD "\\d*"
#else
@@ -123,7 +123,7 @@
*/
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
*/