[PATCH v1] env: add w flags for net config in explicit write mode
Benjamin ROBIN
benjamin.robin at bootlin.com
Sat Jan 24 12:35:19 CET 2026
Hello,
On Saturday, January 24, 2026 at 6:40 AM, Heiko Schocher wrote:
> From: Adrian Freihofer <adrian.freihofer at siemens.com>
>
> In explicit write access mode (CONFIG_ENV_WRITEABLE_LIST) the
> environment variables listed in NET_FLAGS and NET6_FLAGS are
> probably intended to be writeable. Therefore add the 'w' flag
> to these variables.
Users who enable CONFIG_ENV_WRITEABLE_LIST typically want full control over
which environment variables are writable. The new default behavior introduced
by your patch might not align with what all users expect or want.
Would overriding the flags using CFG_ENV_FLAGS_LIST_STATIC not work in this
case?
> diff --git a/include/env_flags.h b/include/env_flags.h
> index 0c48874690f..fc65dcaba21 100644
> --- a/include/env_flags.h
> +++ b/include/env_flags.h
> @@ -56,6 +56,16 @@ enum env_flags_varaccess {
> #define ETHADDR_FLAGS "eth" ETHADDR_WILDCARD "addr:mo,"
> #endif
> #endif
> +#ifdef CONFIG_ENV_WRITEABLE_LIST
> +#define NET_FLAGS \
> + "ipaddr:iw," \
> + "gatewayip:iw," \
> + "netmask:iw," \
> + "serverip:iw," \
> + "nvlan:dw," \
> + "vlan:dw," \
> + "dnsip:iw,"
> +#else
> #define NET_FLAGS \
> "ipaddr:i," \
> "gatewayip:i," \
> @@ -64,16 +74,24 @@ enum env_flags_varaccess {
> "nvlan:d," \
> "vlan:d," \
> "dnsip:i,"
> +#endif
> #else
> #define ETHADDR_FLAGS
> #define NET_FLAGS
> #endif
>
> #ifdef CONFIG_IPV6
> +#ifdef CONFIG_ENV_WRITEABLE_LIST
> +#define NET6_FLAGS \
> + "ip6addr:sw," \
> + "serverip6:sw," \
> + "gatewayip6:sw,"
> +#else
> #define NET6_FLAGS \
> "ip6addr:s," \
> "serverip6:s," \
> "gatewayip6:s,"
> +#endif
> #else
> #define NET6_FLAGS
> #endif
Best regards,
--
Benjamin Robin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the U-Boot
mailing list