[PATCH] net: dhcp: Fix CONFIG_ENVIRONMENT_VARIABLES check

Wadim Egorov w.egorov at phytec.de
Fri Jun 5 01:43:20 PDT 2015


Please squash this patch into
[PATCH v3 2/3] net: dhcp: Split dhcp funcionality & add dhcp command

Signed-off-by: Wadim Egorov <w.egorov at phytec.de>
---
 net/dhcp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/dhcp.c b/net/dhcp.c
index eb4bb38..e1625ec 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -141,7 +141,7 @@ static void env_ip_handle(struct dhcp_opt *opt, unsigned char *popt, int optlen)
 	IPaddr_t ip;
 
 	ip = net_read_ip(popt);
-	if (IS_ENABLED(ENVIRONMENT_VARIABLES))
+	if (IS_ENABLED(CONFIG_ENVIRONMENT_VARIABLES))
 		setenv_ip(opt->barebox_var_name, ip);
 }
 
@@ -262,7 +262,7 @@ static int dhcp_set_string_options(struct dhcp_param *param, u8 *e)
 	int str_len;
 	char* str = param->data;
 
-	if (!str && param->barebox_var_name && IS_ENABLED(ENVIRONMENT_VARIABLES))
+	if (!str && param->barebox_var_name && IS_ENABLED(CONFIG_ENVIRONMENT_VARIABLES))
 		str = (char*)getenv(param->barebox_var_name);
 
 	if (!str && param->barebox_dhcp_global && IS_ENABLED(CONFIG_GLOBALVAR))
@@ -390,7 +390,7 @@ static void bootp_copy_net_params(struct bootp *bp)
 		net_set_serverip(tmp_ip);
 
 	if (strlen(bp->bp_file) > 0) {
-		if (IS_ENABLED(ENVIRONMENT_VARIABLES))
+		if (IS_ENABLED(CONFIG_ENVIRONMENT_VARIABLES))
 			setenv("bootfile", bp->bp_file);
 		if (IS_ENABLED(CONFIG_GLOBALVAR))
 			dhcp_set_barebox_global("bootfile", bp->bp_file);
@@ -652,7 +652,7 @@ static void dhcp_reset_env(void)
 		if (!opt->barebox_var_name || opt->copy_only_if_valid)
 			continue;
 
-		if (IS_ENABLED(ENVIRONMENT_VARIABLES))
+		if (IS_ENABLED(CONFIG_ENVIRONMENT_VARIABLES))
 			setenv(opt->barebox_var_name, "");
 		if (opt->barebox_dhcp_global && IS_ENABLED(CONFIG_GLOBALVAR))
 			dhcp_set_barebox_global(opt->barebox_dhcp_global, "");
-- 
1.9.1




More information about the barebox mailing list