lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 22 May 2008 14:02:53 -0400
From:	Jeff Garzik <jgarzik@...ox.com>
To:	Wang Chen <wangchen@...fujitsu.com>
CC:	becker@...ld.com, "David S. Miller" <davem@...emloft.net>,
	NETDEV <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb
 failed

Wang Chen wrote:
> If alloc_skb failed, the recieved packet will be dropped. Do not increase
> rx_bytes for dropped packet.
> 
> Signed-off-by: Wang Chen <wangchen@...fujitsu.com>
> ---
>  drivers/net/3c509.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
> index e6c545f..fe6d841 100644
> --- a/drivers/net/3c509.c
> +++ b/drivers/net/3c509.c
> @@ -1063,7 +1063,6 @@ el3_rx(struct net_device *dev)
>  			struct sk_buff *skb;
>  
>  			skb = dev_alloc_skb(pkt_len+5);
> -			dev->stats.rx_bytes += pkt_len;
>  			if (el3_debug > 4)
>  				printk("Receiving packet size %d status %4.4x.\n",
>  					   pkt_len, rx_status);
> @@ -1078,6 +1077,7 @@ el3_rx(struct net_device *dev)
>  				skb->protocol = eth_type_trans(skb,dev);
>  				netif_rx(skb);
>  				dev->last_rx = jiffies;
> +				dev->stats.rx_bytes += pkt_len;
>  				dev->stats.rx_packets++;
>  				continue;

applied


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ