Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 1997 10:17:41 -0700 (MST)
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
Message-ID:  <Pine.BSF.3.91.970204100202.8654C-100000@darkstar>
In-Reply-To: <199702041659.QAA00486@ui-gate.utell.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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?Pine.BSF.3.91.970204100202.8654C-100000>