diff options
author | Andy Fleming <afleming@freescale.com> | 2008-03-24 11:53:27 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-26 00:44:39 -0400 |
commit | 99da5003a5b085c12d996da1010e276e9b88672f (patch) | |
tree | 23fb14628162cfd1c64092e1c61327a098b1edf8 /drivers/net/gianfar.c | |
parent | faa89577621b4296a8869e75b90a546c951df968 (diff) |
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 <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 0ab4b26c79a5..a59edf7eacdc 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) | |||
1526 | rmb(); | 1526 | rmb(); |
1527 | skb = priv->rx_skbuff[priv->skb_currx]; | 1527 | skb = priv->rx_skbuff[priv->skb_currx]; |
1528 | 1528 | ||
1529 | if (!(bdp->status & | 1529 | if ((bdp->status & RXBD_LAST) && !(bdp->status & RXBD_ERR)) { |
1530 | (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET | ||
1531 | | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) { | ||
1532 | /* Increment the number of packets */ | 1530 | /* Increment the number of packets */ |
1533 | dev->stats.rx_packets++; | 1531 | dev->stats.rx_packets++; |
1534 | howmany++; | 1532 | howmany++; |