From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephane Ouellette Date: Tue, 14 Jan 2003 13:22:05 +0000 Subject: Re: [LARTC] Is negative offset possible in u32 ? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Eric Leblond wrote: >Has somebody realyy manage to use the examples given when using negative >offset in u32 ? > >I look at the kernel code, I'm almost a real beginner here so I could >wrote stupid things : > >I saw that in the file cls_u32.c we work with skb and use only >skb->nh.raw. That's the network header, so we don't have any information >about Ethernet header (it's in skb->mac.raw that we have the ethernet >header and that the protocol is given). >Furthermore (maybe i'm wrong cause of inverted stockage in memory) in >the skbuf struct the ethernet header union follow the network header >union so we should read something else. >Thus we can at least say that negative offset in u32 are really "tricky" >and really non clean and as seems to show experiment that they don't >work (?) > > > Eric, the following offsets are from a mail previously posted on this list. I hope it helps. Stephane Ouellette. Decimal Ofs Description ----------------------------------- -14: DST MAC, 6 bytes -8: SRC MAC, 6 bytes -2: Eth PROTO, 2 bytes, eg. ETH_P_IP 0: Protocol header (IP Header) _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/