From owner-freebsd-hackers Tue Feb 4 10:39:08 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id KAA03606 for hackers-outgoing; Tue, 4 Feb 1997 10:39:08 -0800 (PST) Received: from ui-gate.utell.co.uk (ui-gate.utell.co.uk [194.200.4.253]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA03592 for ; Tue, 4 Feb 1997 10:39:02 -0800 (PST) Received: from dibble.utell.net (dibble.utell.net [97.3.0.10]) by ui-gate.utell.co.uk (8.7.6/8.7.3) with ESMTP id SAA02367; Tue, 4 Feb 1997 18:37:30 GMT Message-Id: <199702041837.SAA02367@ui-gate.utell.co.uk> From: "Brian Somers" To: "Charles Mott" Cc: "Julian Elischer" , "Eivind Eklund" , "Brian Somers" , "Ari Suutari" , Subject: Re: Single socket version of natd Date: Tue, 4 Feb 1997 18:37:30 -0000 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 Don't _EVER_ lose your sense of humour ---------- > From: Charles Mott > To: Brian Somers > Cc: Julian Elischer ; Eivind Eklund ; Brian Somers ; Ari Suutari ; 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