sky2: check drop truncated packets
If packet larger than MTU is received, the driver uses hardware to truncate the packet. Use the status registers to catch/drop them. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
committed by
Jeff Garzik
parent
f4331a6d24
commit
71749531f2
@@ -2109,6 +2109,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
|
|||||||
if (!(status & GMR_FS_RX_OK))
|
if (!(status & GMR_FS_RX_OK))
|
||||||
goto resubmit;
|
goto resubmit;
|
||||||
|
|
||||||
|
if (status >> 16 != length)
|
||||||
|
goto len_mismatch;
|
||||||
|
|
||||||
if (length < copybreak)
|
if (length < copybreak)
|
||||||
skb = receive_copy(sky2, re, length);
|
skb = receive_copy(sky2, re, length);
|
||||||
else
|
else
|
||||||
@@ -2118,6 +2121,11 @@ resubmit:
|
|||||||
|
|
||||||
return skb;
|
return skb;
|
||||||
|
|
||||||
|
len_mismatch:
|
||||||
|
/* Truncation of overlength packets
|
||||||
|
causes PHY length to not match MAC length */
|
||||||
|
++sky2->net_stats.rx_length_errors;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
++sky2->net_stats.rx_errors;
|
++sky2->net_stats.rx_errors;
|
||||||
if (status & GMR_FS_RX_FF_OV) {
|
if (status & GMR_FS_RX_FF_OV) {
|
||||||
|
Reference in New Issue
Block a user