Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71749531f2d1954137a1a77422ef4ff29eb102dd Commit: 71749531f2d1954137a1a77422ef4ff29eb102dd Parent: f4331a6d24f2e5524678caf4621d35f33fb934da Author: Stephen Hemminger <[EMAIL PROTECTED]> AuthorDate: Mon Jul 9 15:33:40 2007 -0700 Committer: Jeff Garzik <[EMAIL PROTECTED]> CommitDate: Tue Jul 10 12:22:29 2007 -0400
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 <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/sky2.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 99a9993..4e0b839 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -2109,6 +2109,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, if (!(status & GMR_FS_RX_OK)) goto resubmit; + if (status >> 16 != length) + goto len_mismatch; + if (length < copybreak) skb = receive_copy(sky2, re, length); else @@ -2118,6 +2121,11 @@ resubmit: return skb; +len_mismatch: + /* Truncation of overlength packets + causes PHY length to not match MAC length */ + ++sky2->net_stats.rx_length_errors; + error: ++sky2->net_stats.rx_errors; if (status & GMR_FS_RX_FF_OV) { - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html