]> Git Repo - linux.git/commitdiff
ibm_newemac: Fixes entry of short packets
authorSathya Narayanan <[email protected]>
Tue, 1 Jul 2008 08:58:19 +0000 (10:58 +0200)
committerJeff Garzik <[email protected]>
Fri, 4 Jul 2008 12:17:20 +0000 (08:17 -0400)
Short packets has to be discarded by the driver. So this patch addresses the
issue of discarding the short packets of size lesser then ethernet header
size.

Signed-off-by: Sathya Narayanan <[email protected]>
Signed-off-by: Stefan Roese <[email protected]>
Signed-off-by: Jeff Garzik <[email protected]>
drivers/net/ibm_newemac/core.c

index ca63fa000ee7573dfac3d3e330ede857c3900362..babc79ad490b6ada422a3ce96f9fefd510050b65 100644 (file)
@@ -1636,6 +1636,12 @@ static int emac_poll_rx(void *param, int budget)
                        goto next;
                }
 
+               if (len < ETH_HLEN) {
+                       ++dev->estats.rx_dropped_stack;
+                       emac_recycle_rx_skb(dev, slot, len);
+                       goto next;
+               }
+
                if (len && len < EMAC_RX_COPY_THRESH) {
                        struct sk_buff *copy_skb =
                            alloc_skb(len + EMAC_RX_SKB_HEADROOM + 2, GFP_ATOMIC);
This page took 0.058704 seconds and 4 git commands to generate.