From owner-freebsd-hackers Wed Feb 5 11:02:46 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA02061 for hackers-outgoing; Wed, 5 Feb 1997 11:02:46 -0800 (PST) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA02047 for ; Wed, 5 Feb 1997 11:02:38 -0800 (PST) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id LAA24435; Wed, 5 Feb 1997 11:02:07 -0800 (PST) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma024431; Wed Feb 5 11:01:57 1997 Received: (from archie@localhost) by bubba.whistle.com (8.7.5/8.6.12) id LAA23740; Wed, 5 Feb 1997 11:01:57 -0800 (PST) From: Archie Cobbs Message-Id: <199702051901.LAA23740@bubba.whistle.com> Subject: Re: Single socket version of natd In-Reply-To: <199702050149.BAA29882@awfulhak.demon.co.uk> from Brian Somers at "Feb 5, 97 01:49:00 am" To: brian@awfulhak.demon.co.uk (Brian Somers) Date: Wed, 5 Feb 1997 11:01:57 -0800 (PST) Cc: brian@utell.co.uk, cmott@srv.net, julian@whistle.com, eivind@dimaga.com, ari.suutari@ps.carel.fi, hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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)) ? Please do! -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com