From 99da5003a5b085c12d996da1010e276e9b88672f Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Mon, 24 Mar 2008 10:53:27 -0500 Subject: gianfar: Only process completed frames If the LAST bit is not set in the RxBD, it's possible we're processing an incomplete frame, which is bad. While we're at it, add a constant for the error bitmask, so the whole if-clause fits on one line, and is more legible. Signed-off-by: Dai Haruki Signed-off-by: Andy Fleming Signed-off-by: Jeff Garzik --- drivers/net/gianfar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/net/gianfar.c') diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 0ab4b26c79a..a59edf7eacd 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -1526,9 +1526,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) rmb(); skb = priv->rx_skbuff[priv->skb_currx]; - if (!(bdp->status & - (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET - | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) { + if ((bdp->status & RXBD_LAST) && !(bdp->status & RXBD_ERR)) { /* Increment the number of packets */ dev->stats.rx_packets++; howmany++; -- cgit v1.2.3