From owner-freebsd-current@FreeBSD.ORG Tue Jul 6 10:13:00 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBCC516A4CE for ; Tue, 6 Jul 2004 10:13:00 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45F9E43D1D for ; Tue, 6 Jul 2004 10:13:00 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 490B5530C; Tue, 6 Jul 2004 12:12:58 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id D70605309; Tue, 6 Jul 2004 12:12:50 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id B8409B860; Tue, 6 Jul 2004 12:12:50 +0200 (CEST) To: Divacky Roman References: <20040705133820.GA9159@stud.fit.vutbr.cz> <20040705161059.GA52584@walton.maths.tcd.ie> <20040706082906.GA50212@stud.fit.vutbr.cz> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Tue, 06 Jul 2004 12:12:50 +0200 In-Reply-To: <20040706082906.GA50212@stud.fit.vutbr.cz> (Divacky Roman's message of "Tue, 6 Jul 2004 10:29:06 +0200") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.5 required=5.0 tests=AWL,MAILTO_TO_SPAM_ADDR autolearn=no version=2.63 cc: current@freebsd.org Subject: Re: recent libalias changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 10:13:01 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Divacky Roman writes: > the patch works... > > pls commit Done. Could you please also test this one? It fixes an aliasing violation in another checksum function in libalias (at least partially, I may have to rewrite the entire function). DES --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=alias_util.diff Index: lib/libalias/alias_util.c =================================================================== RCS file: /home/ncvs/src/lib/libalias/alias_util.c,v retrieving revision 1.14 diff -u -r1.14 alias_util.c --- lib/libalias/alias_util.c 5 Jul 2004 11:10:57 -0000 1.14 +++ lib/libalias/alias_util.c 6 Jul 2004 10:09:57 -0000 @@ -73,9 +73,11 @@ nbytes -= 2; } if (nbytes == 1) { - oddbyte = 0; - ((u_char *) & oddbyte)[0] = *(u_char *) ptr; - ((u_char *) & oddbyte)[1] = 0; +#if BYTE_ORDER == LITTLE_ENDIAN + oddbyte = *(uint8_t *)ptr; +#else + oddbyte = *(uint8_t *)ptr * 256; +#endif sum += oddbyte; } sum = (sum >> 16) + (sum & 0xffff); --=-=-=--