diff mbox

[U-Boot,v3,11/18] net: Don't write the "serverip" env var if configured not to

Message ID 1337795964-19261-12-git-send-email-joe.hershberger@ni.com
State Accepted
Commit a3e1a727fe8a8b0294fe3ffbc8dcd2f14a4e5a4e
Delegated to: Joe Hershberger
Headers show

Commit Message

Joe Hershberger May 23, 2012, 5:59 p.m. UTC
Before this patch, bootp would not overwrite the value, but the
value was still clobbered in the env

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
---
Changes for v2:
   - Added a comment
Changes for v3:
   - Rebased onto other changed patches
   - Fixed comment style

 common/cmd_net.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 65f32bc..2f66056 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -153,12 +153,16 @@  static void netboot_update_env (void)
 		ip_to_string (NetOurIP, tmp);
 		setenv ("ipaddr", tmp);
 	}
-
+#if !defined(CONFIG_BOOTP_SERVERIP)
+	/*
+	 * Only attempt to change serverip if net/bootp.c:BootpCopyNetParams()
+	 * could have set it
+	 */
 	if (NetServerIP) {
 		ip_to_string (NetServerIP, tmp);
 		setenv ("serverip", tmp);
 	}
-
+#endif
 	if (NetOurDNSIP) {
 		ip_to_string (NetOurDNSIP, tmp);
 		setenv ("dnsip", tmp);