summaryrefslogtreecommitdiffstats
path: root/commands/net.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-08-19 14:20:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-10-13 10:49:21 +0200
commit9296260a7858f0e9cb4d0123bdabd72f1e457bbd (patch)
tree1759e33bbd3ffed2fad8007f53ad753ef3f8c036 /commands/net.c
parent3487f1ee8e0345ed22c6097be4466c0b96590604 (diff)
downloadbarebox-9296260a7858f0e9cb4d0123bdabd72f1e457bbd.tar.gz
barebox-9296260a7858f0e9cb4d0123bdabd72f1e457bbd.tar.xz
net: split NetLoop in NetLoop and NetLoopInit
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/net.c')
-rw-r--r--commands/net.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/commands/net.c b/commands/net.c
index c7418264dc..c079af1329 100644
--- a/commands/net.c
+++ b/commands/net.c
@@ -151,6 +151,9 @@ static int do_dhcp (cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int size;
+ if (NetLoopInit(DHCP) < 0)
+ return 1;
+
if ((size = NetLoop(DHCP)) < 0)
return 1;
@@ -217,6 +220,9 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
safe_strncpy (BootFile, remotefile, sizeof(BootFile));
+ if (NetLoopInit(proto) < 0)
+ goto out;
+
if ((size = NetLoop(proto)) < 0) {
rcode = size;
goto out;
@@ -256,6 +262,9 @@ static int do_cdp (cmd_tbl_t *cmdtp, int argc, char *argv[])
{
int r;
+ if (NetLoopInit(CDP) < 0)
+ return 1;
+
r = NetLoop(CDP);
if (r < 0) {
printf("cdp failed; perhaps not a CISCO switch?\n");