[PATCH]: 1st step to remove skb_linearize() in ip6_tables.c and optimization
Harald Welte
laforge@netfilter.org
Sun, 1 Aug 2004 20:11:50 +0200
--dCSxeJc5W8HZXZrD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Sun, Aug 01, 2004 at 07:08:59PM +0200, Patrick McHardy wrote:
> >> struct tcphdr hdr;
> >> struct tcphdr *tcph
> >>
> >> tcph =3D 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=
=20
> >>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.
>
> The number of copies will still depend on the ruleset with non-linear skb=
s.
> skb_linearize_partial sounds like a much better idea to me.
Oh yes, indeed. I somehow mis-interpreted Yasuyiki's approach. We
should linearize with the first call, so that every 2nd, 3rd, ... call
do nothing but immediately return.
> Regards
> Patrick
--=20
- Harald Welte <laforge@netfilter.org> http://www.netfilter.org/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
"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
--dCSxeJc5W8HZXZrD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBDTJmXaXGVTD0i/8RAgcXAJ98XRW38WY2RLgvb9txCMQk399y7ACfXndn
RaI8VHI8ty+XVy71BrSjPcs=
=KbUq
-----END PGP SIGNATURE-----
--dCSxeJc5W8HZXZrD--