summaryrefslogtreecommitdiffstats
path: root/net/ifup.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-12-11 21:17:23 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-12-01 12:33:33 +0100
commit8b72bac28459ab818b2a308690e61d683e511bba (patch)
tree205c7bd40248090f19def71d6512025c87d49618 /net/ifup.c
parentd8bc8a33d9a4d39c2ac84cc7d119054bf12e16d3 (diff)
downloadbarebox-8b72bac28459ab818b2a308690e61d683e511bba.tar.gz
barebox-8b72bac28459ab818b2a308690e61d683e511bba.tar.xz
net: introduce global.net.server
The server to use is independent of the network device, there is not much point to make the server specific to a network device. This introduces global.net.server as the serverip which is used as standard NFS/tftp server. The previously used eth device specific parameters still exist, but are only aliases for the global single variable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/ifup.c')
-rw-r--r--net/ifup.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ifup.c b/net/ifup.c
index 5113d13832..2b13a9f140 100644
--- a/net/ifup.c
+++ b/net/ifup.c
@@ -109,14 +109,19 @@ int ifup(const char *name, unsigned flags)
dev_set_param(dev, "linux.bootargs", "ip=dhcp");
} else if (!strcmp(ip, "static")) {
char *bootarg;
+ IPaddr_t serverip;
+
for (i = 0; i < ARRAY_SIZE(vars); i++) {
ret = eth_set_param(dev, vars[i]);
if (ret)
goto out;
}
+
+ serverip = net_get_serverip();
+
bootarg = basprintf("ip=%pI4:%pI4:%pI4:%pI4:::",
&edev->ipaddr,
- &edev->serverip,
+ &serverip,
&edev->gateway,
&edev->netmask);
dev_set_param(dev, "linux.bootargs", bootarg);