netfilter: nf_conntrack_acct: use skb->len for accounting
authorChangli Gao <xiaosuo@gmail.com>
Mon, 2 Aug 2010 15:56:28 +0000 (17:56 +0200)
committerPatrick McHardy <kaber@trash.net>
Mon, 2 Aug 2010 15:56:28 +0000 (17:56 +0200)
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>
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/netfilter/nf_conntrack_core.c

index 16b41b4e2a3c18a4b7979f19d51a91a9427761ae..df3eedb142ff809b9ce8f9dd49c41782f91aba42 100644 (file)
@@ -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);
                }
        }