DHCP has a C API, so use it instead of running as command. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- net/ifup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/ifup.c b/net/ifup.c index f6ccd70378..0f5d2772e8 100644 --- a/net/ifup.c +++ b/net/ifup.c @@ -22,6 +22,7 @@ #include <command.h> #include <common.h> #include <getopt.h> +#include <dhcp.h> #include <net.h> #include <fs.h> #include <linux/stat.h> @@ -114,15 +115,12 @@ 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); - dhcp_cmd = basprintf("dhcp %s", name); - ret = run_command(dhcp_cmd); - free(dhcp_cmd); + ret = dhcp(edev, NULL); if (ret) goto out; dev_set_param(dev, "linux.bootargs", "ip=dhcp"); -- 2.11.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox