diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-20 22:46:47 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-12-14 14:29:42 +0100 |
commit | ab84733e570b889324f2594685f7f5d33b3c39be (patch) | |
tree | 0a75d7c782667cefb892b8a86772875f62a879c9 /net/ifup.c | |
parent | 946bc95a4de8247ea884a3932470344e59618c3a (diff) | |
download | barebox-ab84733e570b889324f2594685f7f5d33b3c39be.tar.gz barebox-ab84733e570b889324f2594685f7f5d33b3c39be.tar.xz |
net: dhcp: Allow to specify network device
Instead of allowing to DHCP only on the "current" network
device, allow to specify the desired network device. This
is a first step to get rid of the concept of a "current"
network device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/ifup.c')
-rw-r--r-- | net/ifup.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ifup.c b/net/ifup.c index c3ea1b6a45..2160e3ae46 100644 --- a/net/ifup.c +++ b/net/ifup.c @@ -101,12 +101,15 @@ int ifup(const char *name, unsigned flags) if (!strcmp(ip, "dhcp")) { IPaddr_t serverip; + char *dhcp_cmd; serverip = getenv_ip("serverip"); if (serverip) net_set_serverip_empty(serverip); - ret = run_command("dhcp"); + dhcp_cmd = basprintf("dhcp %s", name); + ret = run_command(dhcp_cmd); + free(dhcp_cmd); if (ret) goto out; dev_set_param(dev, "linux.bootargs", "ip=dhcp"); |