From 6e5923851ec5c11a36136abc77160d834537c4dd Mon Sep 17 00:00:00 2001 From: wdenk Date: Sun, 18 Apr 2004 17:39:38 +0000 Subject: * Cleanup, minor fixes * Patch by Rune Torgersen, 16 Apr 2004: LBA48 fixes * Patches by Pantelis Antoniou, 16 Apr 2004: - Fix some compile problems; add "once" functionality for the netretry variable --- common/cmd_net.c | 78 ++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 45 deletions(-) (limited to 'common/cmd_net.c') diff --git a/common/cmd_net.c b/common/cmd_net.c index 85a90237342..5989733f9ce 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -94,62 +94,50 @@ U_BOOT_CMD( ); #endif /* CFG_CMD_NFS */ -static void netboot_update_env(void) +static void netboot_update_env (void) { - char tmp[22] ; + char tmp[22]; - if (NetOurGatewayIP) { - ip_to_string (NetOurGatewayIP, tmp); - setenv("gatewayip", tmp); - } - - if (NetOurSubnetMask) { - ip_to_string (NetOurSubnetMask, tmp); - setenv("netmask", tmp); - } + if (NetOurGatewayIP) { + ip_to_string (NetOurGatewayIP, tmp); + setenv ("gatewayip", tmp); + } - if (NetOurHostName[0]) - setenv("hostname", NetOurHostName); + if (NetOurSubnetMask) { + ip_to_string (NetOurSubnetMask, tmp); + setenv ("netmask", tmp); + } - if (NetOurRootPath[0]) - setenv("rootpath", NetOurRootPath); + if (NetOurHostName[0]) + setenv ("hostname", NetOurHostName); - if (NetOurIP) { - ip_to_string (NetOurIP, tmp); - setenv("ipaddr", tmp); - } + if (NetOurRootPath[0]) + setenv ("rootpath", NetOurRootPath); - if (NetServerIP) { - ip_to_string (NetServerIP, tmp); - setenv("serverip", tmp); - } + if (NetOurIP) { + ip_to_string (NetOurIP, tmp); + setenv ("ipaddr", tmp); + } - if (NetOurDNSIP) { - ip_to_string (NetOurDNSIP, tmp); - setenv("dnsip", tmp); - } + if (NetServerIP) { + ip_to_string (NetServerIP, tmp); + setenv ("serverip", tmp); + } + if (NetOurDNSIP) { + ip_to_string (NetOurDNSIP, tmp); + setenv ("dnsip", tmp); + } #if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_DNS2) - if (NetOurDNS2IP) { - ip_to_string (NetOurDNS2IP, tmp); - setenv("dnsip2", tmp); - } + if (NetOurDNS2IP) { + ip_to_string (NetOurDNS2IP, tmp); + setenv ("dnsip2", tmp); + } #endif - - if (NetOurNISDomain[0]) - setenv("domain", NetOurNISDomain); - - if (ntohs(NetOurVLAN) != (ushort)-1) { - VLAN_to_string(NetOurVLAN, tmp); - setenv("vlan", tmp); - } - - if (ntohs(NetOurNativeVLAN) != (ushort)-1) { - VLAN_to_string(NetOurNativeVLAN, tmp); - setenv("vlan", tmp); - } - + if (NetOurNISDomain[0]) + setenv ("domain", NetOurNISDomain); } + static int netboot_common (int proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) { -- cgit v1.2.3