summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/net.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/commands/net.c b/commands/net.c
index 815a566a2b..949963ffdc 100644
--- a/commands/net.c
+++ b/commands/net.c
@@ -39,12 +39,16 @@ void netboot_update_env(void)
{
struct eth_device *eth_current = eth_get_current();
char tmp[22];
+ IPaddr_t net_gateway_ip = NetOurGatewayIP;
+ IPaddr_t net_ip = NetOurIP;
+ IPaddr_t net_server_ip = NetServerIP;
+ IPaddr_t netmask = NetOurSubnetMask;
- if (NetOurGatewayIP)
- dev_set_param_ip(&eth_current->dev, "gateway", NetOurGatewayIP);
+ if (net_gateway_ip)
+ dev_set_param_ip(&eth_current->dev, "gateway", net_gateway_ip);
- if (NetOurSubnetMask)
- dev_set_param_ip(&eth_current->dev, "netmask", NetOurSubnetMask);
+ if (netmask)
+ dev_set_param_ip(&eth_current->dev, "netmask", netmask);
if (NetOurHostName[0])
@@ -53,11 +57,11 @@ void netboot_update_env(void)
if (NetOurRootPath[0])
setenv ("rootpath", NetOurRootPath);
- if (NetOurIP)
- dev_set_param_ip(&eth_current->dev, "ipaddr", NetOurIP);
+ if (net_ip)
+ dev_set_param_ip(&eth_current->dev, "ipaddr", net_ip);
- if (NetServerIP)
- dev_set_param_ip(&eth_current->dev, "serverip", NetServerIP);
+ if (net_server_ip)
+ dev_set_param_ip(&eth_current->dev, "serverip", net_server_ip);
if (NetOurDNSIP) {
ip_to_string (NetOurDNSIP, tmp);