Kaynağa Gözat

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>
Changli Gao 15 yıl önce
ebeveyn
işleme
6661481d5a
1 değiştirilmiş dosya ile 1 ekleme ve 2 silme
  1. 1 2
      net/netfilter/nf_conntrack_core.c

+ 1 - 2
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);
 		}
 	}