Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Dec 2004 16:26:02 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iBV0PYAf009407 for ; Thu, 30 Dec 2004 16:25:55 -0800 Received: from eru.coreworks.de ([172.16.0.2] helo=trash.net) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CkAkJ-0004w7-2D; Fri, 31 Dec 2004 01:34:23 +0100 Message-ID: <41D49E4B.2020007@trash.net> Date: Fri, 31 Dec 2004 01:33:15 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: Bart De Schuymer CC: Lennert Buytenhek , "David S. Miller" , netdev@oss.sgi.com, snort2004@mail.ru Subject: Re: [PATCH][BRIDGE-NF] Fix wrong use of skb->protocol References: <1104432914.15601.19.camel@localhost.localdomain> <20041230222415.GB19587@xi.wantstofly.org> <1104448248.15601.55.camel@localhost.localdomain> In-Reply-To: <1104448248.15601.55.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13261 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Bart De Schuymer wrote: > Hi Lennert, > > skb->protocol is not set for locally generated packets when the packet > is still in the IP stack. I don't know what happens with it after the IP > stack is finished with the packet. It is set shortly before the packet leaves the IP stack, in ip_finish_output. This is after LOCAL_OUT, but before POST_ROUTING. So your fix looks fine. > The comment in skbuff.h says "packet protocol from driver", from which I > tend to conclude that skb->protocol is only set by drivers when a packet > enters the box. Too bad stuff like this isn't clearly spelled out, the > FIXME for the dst field has been sitting there for probably more than a > year too. Anyway, it wouldn't hurt if the skb->protocol field always > held the right value. The IP stack knows it's IP anyway :) After that it has to hold the right value. Regards Patrick