Date: Tue, 4 Feb 1997 18:37:30 -0000 From: "Brian Somers" <brian@utell.co.uk> To: "Charles Mott" <cmott@srv.net> Cc: "Julian Elischer" <julian@whistle.com>, "Eivind Eklund" <eivind@dimaga.com>, "Brian Somers" <brian@awfulhak.demon.co.uk>, "Ari Suutari" <ari.suutari@ps.carel.fi>, <hackers@freebsd.org> Subject: Re: Single socket version of natd Message-ID: <199702041837.SAA02367@ui-gate.utell.co.uk>
next in thread | raw e-mail | index | archive | help
I don't know specifically without checking the code, but I recall seeing a comment in the -current sources (I've just checked SNAP-961014, nothing about it there) about using the ip_sum to differentiate between incoming and outgoing packets..... It *WAS* commented as being a HACK :( I'll check the code out this evening when I get home (-current machine) and tell you. Brian <brian@awfulhak.demon.co.uk> <brian@freebsd.org> <brian@utell.co.uk> <http://www.awfulhak.demon.co.uk> Don't _EVER_ lose your sense of humour ---------- > From: Charles Mott <cmott@srv.net> > To: Brian Somers <brian@utell.co.uk> > Cc: Julian Elischer <julian@whistle.com>; Eivind Eklund <eivind@dimaga.com>; Brian Somers <brian@awfulhak.demon.co.uk>; Ari Suutari <ari.suutari@ps.carel.fi>; hackers@freebsd.org > Subject: Re: Single socket version of natd > Date: 04 February 1997 17:17 > > > If we leave it in both ppp & natd, can we add a (third) arg to > > PacketAlias{In,Out}() that tells it not to do anything with the > > ip_sum ? If it's reading raw packets from a wire (with ppp), > > the sum may be wrong (this has been discussed before) and > > we want to leave incorrect the sum alone, but with natd, it's a > > terrible waste to have the kernel code zero the sum, have natd > > re-calculate it, have PacketAliasIn() check it, and then probably > > re-calculate it again (if anything's changed). > > > > With a "leave the sum alone option", natd could pass the packet > > with the zero'd ip_sum to PacketAliasIn() and know that it has > > to calculate it itself afterwards.... > > Why does the kernel zero the checksum? > > IP checksum has never been much of a problem, because it is only 20 bytes > or so. It is the TCP, UDP and ICMP layers where efficiency pays off. > > In any event, all IP checksums modifications in alias*.c are now > differential, so calculations are only made for packet data which has been > altered. Unlike older versions, there is no checking and recomputation of > the complete IP header. > > Charles Mott
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702041837.SAA02367>