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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100826091800.GI20793@distanz.ch>
Date:	Thu, 26 Aug 2010 11:18:00 +0200
From:	Tobias Klauser <tklauser@...tanz.ch>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH v2] slip: Use net_device_stats from struct net_device

On 2010-08-26 at 10:39:32 +0200, Eric Dumazet <eric.dumazet@...il.com> wrote:
> Le jeudi 26 août 2010 à 10:28 +0200, Tobias Klauser a écrit :
> > @@ -562,12 +563,12 @@ static struct net_device_stats *
> >  sl_get_stats(struct net_device *dev)
> >  {
> >  	struct net_device_stats *stats = &dev->stats;
> > -	struct slip *sl = netdev_priv(dev);
> > -	unsigned long c_rx_dropped = 0;
> >  #ifdef SL_INCLUDE_CSLIP
> > +	unsigned long c_rx_dropped = 0;
> >  	unsigned long c_rx_fifo_errors = 0;
> >  	unsigned long c_tx_fifo_errors = 0;
> >  	unsigned long c_collisions = 0;
> > +	struct slip *sl = netdev_priv(dev);
> >  	struct slcompress *comp = sl->slcomp;
> >  
> >  	if (comp) {
> > @@ -579,17 +580,9 @@ sl_get_stats(struct net_device *dev)
> >  	stats->rx_fifo_errors = sl->rx_compressed + c_rx_fifo_errors;
> >  	stats->tx_fifo_errors = sl->tx_compressed + c_tx_fifo_errors;
> >  	stats->collisions     = sl->tx_misses + c_collisions;
> > +	stats->rx_dropped    += c_rx_dropped;
> 
> Sorry this bit is wrong.
> 
> You cannot do "stats->somefield += somevalue", since its cumulative for
> each call to "cat /proc/net/dev"

Sorry for getting it wrong the second time and wasting your time. I
didn't read your answer to the first patch careful enough (I should have
used ndo_get_stats64 as you clearly stated). Hopefully I get it right in
v3 :-)

Sorry again and thanks a lot
--
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