From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [PATCH] ip6tables: use skb->len for accounting Date: Fri, 23 Jul 2010 14:38:20 +0800 Message-ID: References: <1279855877-8945-1-git-send-email-xiaosuo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: Patrick McHardy , "David S. Miller" , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , netfilter-devel@vger.kernel.org, netdev@vger.kernel.org To: Jan Engelhardt Return-path: Received: from mail-vw0-f46.google.com ([209.85.212.46]:63424 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727Ab0GWGil (ORCPT ); Fri, 23 Jul 2010 02:38:41 -0400 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Fri, Jul 23, 2010 at 2:16 PM, Jan Engelhardt wrote: > > > I wonder how this fares with trailing padding or data, like, when > you have a standard v4/v6 packet created in a raw socket, and append > a bunch of \0s to it. > > For the packets received, ip_rcv, ipv6_rcv and bridge all call pskb_trim_rcsum before feeding them to netfilter. The raw packets are sent via dev_queue_xmit(), and they don't pass through the output path of netfilter. One case, maybe the queued packets mangled "wrongly" in userspace are reinjected, however, we can't prevent a user from changing the payload_len wrongly. -- Regards, Changli Gao(xiaosuo@gmail.com)