netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip6tables: use skb->len for accounting
@ 2010-07-23  3:31 Changli Gao
  2010-07-23  6:16 ` Jan Engelhardt
  2010-07-23 14:24 ` Patrick McHardy
  0 siblings, 2 replies; 8+ messages in thread
From: Changli Gao @ 2010-07-23  3:31 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Patrick McHardy, David S. Miller, Alexey Kuznetsov,
	Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
	netfilter-devel, netdev, Changli Gao

ip6tables: use skb->len for accounting

ipv6_hdr(skb)->payload_len is ZERO and can't be used for accounting, if the
payload is a Jumbo Payload specified in RFC2675.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
 net/ipv6/netfilter/ip6_tables.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index dc41d6d..33113c1 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -387,9 +387,7 @@ ip6t_do_table(struct sk_buff *skb,
 				goto no_match;
 		}
 
-		ADD_COUNTER(e->counters,
-			    ntohs(ipv6_hdr(skb)->payload_len) +
-			    sizeof(struct ipv6hdr), 1);
+		ADD_COUNTER(e->counters, skb->len, 1);
 
 		t = ip6t_get_target_c(e);
 		IP_NF_ASSERT(t->u.kernel.target);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-07-23 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23  3:31 [PATCH] ip6tables: use skb->len for accounting Changli Gao
2010-07-23  6:16 ` Jan Engelhardt
2010-07-23  6:38   ` Changli Gao
2010-07-23 11:48     ` Patrick McHardy
2010-07-23 13:05       ` Changli Gao
2010-07-23 14:21         ` Patrick McHardy
2010-07-23 16:40         ` Jan Engelhardt
2010-07-23 14:24 ` 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).