Discussion:
[U-Boot] [PATCH] net: fix env flags for eth10addr and above
Simon Goldschmidt
2018-11-22 16:06:39 UTC
Permalink
With CONFIG_REGEX enabled, ETHADDR_WILDCARD is set up for up to 10
interfaces (0..9) as the number can only have one digit.

On boards with more than 10 interfaces, this leads to the protection
and format checks being absent for eth10addr and above.

Fix this by changing ETHADDR_WILDCARD from "\\d?" to "\\d*" to allow
more than one digit.

Signed-off-by: Simon Goldschmidt <***@gmail.com>
---

include/env_flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/env_flags.h b/include/env_flags.h
index cc2c34f939..23744e395c 100644
--- a/include/env_flags.h
+++ b/include/env_flags.h
@@ -38,7 +38,7 @@ enum env_flags_varaccess {

#ifdef CONFIG_CMD_NET
#ifdef CONFIG_REGEX
-#define ETHADDR_WILDCARD "\\d?"
+#define ETHADDR_WILDCARD "\\d*"
#else
#define ETHADDR_WILDCARD
#endif
--
2.17.1
Simon Goldschmidt
2018-12-09 20:51:30 UTC
Permalink
Post by Simon Goldschmidt
With CONFIG_REGEX enabled, ETHADDR_WILDCARD is set up for up to 10
interfaces (0..9) as the number can only have one digit.
On boards with more than 10 interfaces, this leads to the protection
and format checks being absent for eth10addr and above.
Fix this by changing ETHADDR_WILDCARD from "\\d?" to "\\d*" to allow
more than one digit.
---
include/env_flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/env_flags.h b/include/env_flags.h
index cc2c34f939..23744e395c 100644
--- a/include/env_flags.h
+++ b/include/env_flags.h
@@ -38,7 +38,7 @@ enum env_flags_varaccess {
#ifdef CONFIG_CMD_NET
#ifdef CONFIG_REGEX
-#define ETHADDR_WILDCARD "\\d?"
+#define ETHADDR_WILDCARD "\\d*"
#else
#define ETHADDR_WILDCARD
#endif
Ping?

Loading...