From owner-freebsd-hackers Tue Feb 4 18:34:28 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id SAA17564 for hackers-outgoing; Tue, 4 Feb 1997 18:34:28 -0800 (PST) Received: from awfulhak.demon.co.uk (raffles.demon.co.uk [158.152.17.201]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id SAA17538 for ; Tue, 4 Feb 1997 18:34:22 -0800 (PST) Received: from awfulhak.demon.co.uk (localhost.coverform.lan [127.0.0.1]) by awfulhak.demon.co.uk (8.8.4/8.7.3) with ESMTP id BAA29882; Wed, 5 Feb 1997 01:49:01 GMT Message-Id: <199702050149.BAA29882@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: "Brian Somers" cc: "Charles Mott" , "Julian Elischer" , "Eivind Eklund" , "Ari Suutari" , hackers@freebsd.org Subject: Re: Single socket version of natd In-reply-to: Your message of "Tue, 04 Feb 1997 18:37:30 GMT." <199702041837.SAA02367@ui-gate.utell.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 05 Feb 1997 01:49:00 +0000 From: Brian Somers 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. [.....] I was lying. There's no such comments ! Does anyone know of a reason (besides the divert(4) man page) that the sum on incoming packets is zero'd ? The code says: [.....] if (hlen == sizeof(struct ip)) { ip->ip_sum = in_cksum_hdr(ip); } else { ip->ip_sum = in_cksum(m, hlen); } if (ip->ip_sum) { ipstat.ips_badsum++; goto bad; } [.....] Is there any problems with changing this to u_short sum; ..... if (hlen == sizeof(struct ip)) { sum = in_cksum_hdr(ip); } else { sum = in_cksum(m, hlen); } if (sum) { ipstat.ips_badsum++; goto bad; } (and updating divert(4)) ? -- Brian , Don't _EVER_ lose your sense of humour....