1 Aug 2004 18:46
Re: [PATCH]: 1st step to remove skb_linearize() in ip6_tables.c and optimization
Harald Welte <laforge <at> netfilter.org>
2004-08-01 16:46:53 GMT
2004-08-01 16:46:53 GMT
On Thu, Jul 29, 2004 at 03:09:02PM +0900, Yasuyuki Kozakai wrote: > I got time to implement your idea. How about this ? (not tested) > > struct tcphdr hdr; > struct tcphdr *tcph > > tcph = skb_get_bits(skb, &hdr, skb->nh.iph->ihl*4, sizeof(hdr)); > > If skb is neither shared nor cloned, this function linearize up to tcp header > and returns the pointer to tcp header in skb. > > Otherwise, copies tcp header to "hdr" and return the pointer to it. > If error, return NULL. This sounds like a very sane approach to me. Since we don't have stable API's in 2.6.x anymore (kernel summit decision), we could even put this in our pending queue of patches for something like 2.6.10/2.6.11 What does eveybody else think? Comments? -- -- - Harald Welte <laforge <at> netfilter.org> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
RSS Feed