Commit 6661481d5a8975657742c7ed40ae16bdaa7d0a6e

Authored by Changli Gao
Committed by Patrick McHardy
1 parent 2452a99dc0

netfilter: 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>
Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

net/netfilter/nf_conntrack_core.c
... ... @@ -966,8 +966,7 @@
966 966 if (acct) {
967 967 spin_lock_bh(&ct->lock);
968 968 acct[CTINFO2DIR(ctinfo)].packets++;
969   - acct[CTINFO2DIR(ctinfo)].bytes +=
970   - skb->len - skb_network_offset(skb);
  969 + acct[CTINFO2DIR(ctinfo)].bytes += skb->len;
971 970 spin_unlock_bh(&ct->lock);
972 971 }
973 972 }