netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: stable@kernel.org
Cc: netdev@vger.kernel.org
Subject: [PATCH 4/4] sky2: check drop truncated packets
Date: Thu, 16 Aug 2007 09:12:48 -0400	[thread overview]
Message-ID: <20070816131348.817412148@linux-foundation.org> (raw)
In-Reply-To: 20070816131244.726293914@linux-foundation.org

[-- Attachment #1: sky2-stable-trunc.patch --]
[-- Type: text/plain, Size: 909 bytes --]

Backport of commit 71749531f2d1954137a1a77422ef4ff29eb102dd
    
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>

--- a/drivers/net/sky2.c	2007-08-08 22:01:28.000000000 +0100
+++ b/drivers/net/sky2.c	2007-08-08 22:01:37.000000000 +0100
@@ -2065,6 +2065,9 @@ static struct sk_buff *sky2_receive(stru
 	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
@@ -2074,6 +2077,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) {

-- 


      parent reply	other threads:[~2007-08-16 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-16 13:12 [PATCH 0/4] backport of sky2 stability fixes Stephen Hemminger
2007-08-16 13:12 ` [PATCH 1/4] sky2: restore workarounds for lost interrupts Stephen Hemminger
2007-08-16 13:12 ` [PATCH 2/4] sky2: carrier management Stephen Hemminger
2007-08-16 13:12 ` [PATCH 3/4] sky2: check for more work before leaving NAPI Stephen Hemminger
2007-08-16 13:12 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070816131348.817412148@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).