[PATCH 2/2] net/eth: fix missing check on eth active

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Sep 26 07:37:52 EDT 2012


I drop this check in the phylib v7 by mistake. This check is needed to report
when the phy is down

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 net/eth.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/eth.c b/net/eth.c
index beedd22..d3bda81 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -142,6 +142,9 @@ int eth_send(void *packet, int length)
 			eth_current->active = 1;
 	}
 
+	if (!eth_current->active)
+		return -ENETDOWN;
+
 	led_trigger_network(LED_TRIGGER_NET_TX);
 
 	return eth_current->send(eth_current, packet, length);
-- 
1.7.10.4




More information about the barebox mailing list