* [PATCH] nf_conntrack_acct: use skb->len for accounting
@ 2010-07-23 3:39 Changli Gao
2010-08-02 15:56 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: Changli Gao @ 2010-07-23 3:39 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netfilter-devel, netdev, Changli Gao
nf_conntrack_acct: use skb->len for accounting
use skb->len for accounting as xt_quota does. Since nf_conntrack works at
the network layer, skb_network_offset should always returns ZERO.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/netfilter/nf_conntrack_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 16b41b4..df3eedb 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -966,8 +966,7 @@ acct:
if (acct) {
spin_lock_bh(&ct->lock);
acct[CTINFO2DIR(ctinfo)].packets++;
- acct[CTINFO2DIR(ctinfo)].bytes +=
- skb->len - skb_network_offset(skb);
+ acct[CTINFO2DIR(ctinfo)].bytes += skb->len;
spin_unlock_bh(&ct->lock);
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nf_conntrack_acct: use skb->len for accounting
2010-07-23 3:39 [PATCH] nf_conntrack_acct: use skb->len for accounting Changli Gao
@ 2010-08-02 15:56 ` Patrick McHardy
0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2010-08-02 15:56 UTC (permalink / raw)
To: Changli Gao; +Cc: David S. Miller, netfilter-devel, netdev
On 23.07.2010 05:39, Changli Gao wrote:
> use skb->len for accounting as xt_quota does. Since nf_conntrack works at
> the network layer, skb_network_offset should always returns ZERO.
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-02 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 3:39 [PATCH] nf_conntrack_acct: use skb->len for accounting Changli Gao
2010-08-02 15:56 ` Patrick McHardy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).