Subject: Re: [PATCH] iptables: use skb->len for accounting

From: Patrick McHardy <[email-masked]>
Date: Fri, 23 Jul 2010 13:49:11 +0200

On 23.07.2010 08:58, Eric Dumazet wrote:
> Le vendredi 23 juillet 2010 à 14:47 +0800, Changli Gao a écrit :
>> On Fri, Jul 23, 2010 at 2:29 PM, Eric Dumazet <[email-masked]> wrote:
>>> Le vendredi 23 juillet 2010 à 11:34 +0800, Changli Gao a écrit :
>>>> iptables: use skb->len for accounting
>>>>
>>>> use skb->len for accounting as xt_quota does.
>>>>
>>>
>>> Why ?
>>>
>>> This is a gratuitous change, unless you have very strong arguments.
>>>
>>> xt_quota is an exception, dont change all others because of it !
>>
>> exception ? Why ?
> 
> Because it handles all protocols...
> 
> So skb->len is a shortcut, an approximation if you want.
> 
> At IPV4 level, ip->tot_len is an exact value.

Actually skb->len is also exact at the IPv4 level. I'm inclined
to apply this patch for consistency with ip6_tables, where using
skb->len fixes jumbo frame accounting.