summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorsascha <sascha@nomad.localdomain>2007-10-18 11:25:13 +0200
committersascha <sascha@nomad.localdomain>2007-10-18 11:25:13 +0200
commit3c37202662cb30dca373c8dd099638f9ca8e039a (patch)
treedcbd696ff02331212224c04bf4bea7390a9c0454 /net
parenta9791f69f7045604efe9d5a57483b87e95aaa697 (diff)
downloadbarebox-3c37202662cb30dca373c8dd099638f9ca8e039a.tar.gz
barebox-3c37202662cb30dca373c8dd099638f9ca8e039a.tar.xz
check if there is an ethernet device set in NetLoop
Diffstat (limited to 'net')
-rw-r--r--net/net.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index dab7c5a1b1..ad93787248 100644
--- a/net/net.c
+++ b/net/net.c
@@ -258,6 +258,11 @@ NetLoop(proto_t protocol)
struct eth_device *eth_current = eth_get_current();
IPaddr_t ip;
+ if (!eth_current) {
+ printf("Current ethernet device not set!\n");
+ return -1;
+ }
+
ip = dev_get_param_ip(eth_current->dev, "ip");
NetCopyIP(&NetOurIP, &ip);