Re: [PATCH][BRIDGE-NF] Fix wrong use of skb->protocol
From: Patrick McHardy <hidden>
Date: 2004-12-31 00:33:15
From: Patrick McHardy <hidden>
Date: 2004-12-31 00:33:15
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