提交 6e15b712 编写于 作者: S Stephen Hemminger 提交者: Jeff Garzik

[PATCH] sky2: handle hardware packet overrun

It is possible for hardware to get confused when an oversized frame
is received. In that case, just drop the packet and increment a counter.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 6ed995bb
......@@ -1694,6 +1694,9 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2,
if (!(status & GMR_FS_RX_OK))
goto resubmit;
if ((status >> 16) != length || length > sky2->rx_bufsize)
goto oversize;
if (length < copybreak) {
skb = alloc_skb(length + 2, GFP_ATOMIC);
if (!skb)
......@@ -1735,7 +1738,13 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2,
return skb;
oversize:
++sky2->net_stats.rx_over_errors;
goto resubmit;
error:
++sky2->net_stats.rx_errors;
if (netif_msg_rx_err(sky2))
printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n",
sky2->netdev->name, status, length);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册