From owner-freebsd-current Tue Nov 16 6:22:42 1999 Delivered-To: freebsd-current@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id F3BB714BCE for ; Tue, 16 Nov 1999 06:22:34 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id JAA10973; Tue, 16 Nov 1999 09:22:28 -0500 (EST) (envelope-from wollman) Date: Tue, 16 Nov 1999 09:22:28 -0500 (EST) From: Garrett Wollman Message-Id: <199911161422.JAA10973@khavrinen.lcs.mit.edu> To: Bruce Evans Cc: Pierre Beyssac , Garrett Wollman , Sheldon Hearn , freebsd-current@FreeBSD.ORG Subject: Re: egcs -O breaks ping.c:in_cksum() In-Reply-To: References: <19991115194357.T28348@enst.fr> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: > Perhaps the above should be written as: > sum += ntohs(*(u_char *)w << 8); > to avoid the undefined union access (answer.us). No. The IP checksum is defined in a manner which is endian-independent. Adding calls to ntohs() would only confuse matters further. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message