summaryrefslogtreecommitdiff
path: root/net/eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/eth.c')
-rw-r--r--net/eth.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/eth.c b/net/eth.c
index 1a11ce1027..bb4d95be8e 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -500,10 +500,7 @@ int eth_receive(void *packet, int length)
return -1;
}
- if (length < eth_rcv_bufs[eth_rcv_current].length)
- return -1;
-
- length = eth_rcv_bufs[eth_rcv_current].length;
+ length = min(eth_rcv_bufs[eth_rcv_current].length, length);
for (i = 0; i < length; i++)
p[i] = eth_rcv_bufs[eth_rcv_current].data[i];