* [PATCH 1 2.6.7-rc3-bk6] pcnet32: discard oversize rx packets
@ 2004-06-15 18:52 Don Fry
2004-06-19 21:13 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Don Fry @ 2004-06-15 18:52 UTC (permalink / raw)
To: tsbogend, jgarzik, netdev
This patch will discard received frames that are larger than one buffer.
This has been tested on ia32 and ppc64 systems.
Please also apply to 2.4.7 (with offset of -3), tested ia32.
Signed-off by: brazilnut@us.ibm.com
--- linux-2.6.7-rc3-bk6/drivers/net/orig.pcnet32.c Mon Jun 14 12:19:09 2004
+++ linux-2.6.7-rc3-bk6/drivers/net/pcnet32.c Tue Jun 15 09:36:43 2004
@@ -22,8 +22,8 @@
*************************************************************************/
#define DRV_NAME "pcnet32"
-#define DRV_VERSION "1.30c"
-#define DRV_RELDATE "05.25.2004"
+#define DRV_VERSION "1.30d"
+#define DRV_RELDATE "06.01.2004"
#define PFX DRV_NAME ": "
static const char *version =
@@ -245,6 +245,7 @@ static int full_duplex[MAX_UNITS];
* v1.30b 24 May 2004 Don Fry fix bogus tx carrier errors with 79c973,
* assisted by Bruce Penrod <bmpenrod@endruntechnologies.com>.
* v1.30c 25 May 2004 Don Fry added netif_wake_queue after pcnet32_restart.
+ * v1.30d 01 Jun 2004 Don Fry discard oversize rx packets.
*/
@@ -1907,7 +1908,13 @@ pcnet32_rx(struct net_device *dev)
short pkt_len = (le32_to_cpu(lp->rx_ring[entry].msg_length) & 0xfff)-4;
struct sk_buff *skb;
- if (pkt_len < 60) {
+ /* Discard oversize frames. */
+ if (unlikely(pkt_len > PKT_BUF_SZ - 2)) {
+ if (netif_msg_drv(lp))
+ printk(KERN_ERR "%s: Impossible packet size %d!\n",
+ dev->name, pkt_len);
+ lp->stats.rx_errors++;
+ } else if (pkt_len < 60) {
if (netif_msg_rx_err(lp))
printk(KERN_ERR "%s: Runt packet!\n", dev->name);
lp->stats.rx_errors++;
--
Don Fry
brazilnut@us.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1 2.6.7-rc3-bk6] pcnet32: discard oversize rx packets
[not found] <20040615115829.46a6a674.rddunlap@osdl.org>
@ 2004-06-15 19:06 ` Don Fry
0 siblings, 0 replies; 3+ messages in thread
From: Don Fry @ 2004-06-15 19:06 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: netdev
My preceeding two patches should have said:
Signed-off-by: Don Fry <brazilnut@us.ibm.com>
Do I need to resubmit them?
> | This patch will discard received frames that are larger than one buffer.
> | This has been tested on ia32 and ppc64 systems.
> |
> | Please also apply to 2.4.7 (with offset of -3), tested ia32.
> |
> | Signed-off by: brazilnut@us.ibm.com
>
> Don-
>
> The requested format is:
>
> Signed-off-by: your name <email address>
>
> --
> ~Randy
--
Don Fry
brazilnut@us.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1 2.6.7-rc3-bk6] pcnet32: discard oversize rx packets
2004-06-15 18:52 [PATCH 1 2.6.7-rc3-bk6] pcnet32: discard oversize rx packets Don Fry
@ 2004-06-19 21:13 ` Jeff Garzik
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2004-06-19 21:13 UTC (permalink / raw)
To: Don Fry; +Cc: tsbogend, netdev
applied all 3 patches to 2.6.x
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-19 21:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-15 18:52 [PATCH 1 2.6.7-rc3-bk6] pcnet32: discard oversize rx packets Don Fry
2004-06-19 21:13 ` Jeff Garzik
[not found] <20040615115829.46a6a674.rddunlap@osdl.org>
2004-06-15 19:06 ` Don Fry
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).