From owner-freebsd-net Wed Nov 15 4: 8: 3 2000 Delivered-To: freebsd-net@freebsd.org Received: from mail.interware.hu (mail.interware.hu [195.70.32.130]) by hub.freebsd.org (Postfix) with ESMTP id E729D37B4C5; Wed, 15 Nov 2000 04:07:58 -0800 (PST) Received: from nairobi-40.budapest.interware.hu ([195.70.50.232] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 13w1Lz-0000tu-00; Wed, 15 Nov 2000 13:07:52 +0100 Message-ID: <3A127C7A.8B8DAA13@elischer.org> Date: Wed, 15 Nov 2000 04:07:22 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Ruslan Ermilov , Charles Mott , Archie Cobbs , net@FreeBSD.ORG, Ari Suutari Subject: Re: libalias: Incremental Update of Internet Checksum References: <20001113103852.E34671@sunbay.com> <3A126F63.8EB0D49@elischer.org> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Julian Elischer wrote: uggggh it reformatted it.. obviously the slashes are at the END of the previouse lines! > > Ruslan Ermilov wrote: > > > Here's the version I wrote some years ago.. > #define FIXSUM16(c, op, np) > \ > do { > \ > (c) -= (u_int16_t) ~*((u_int16_t *) (op)); > \ > if ((c) < 0) { > \ > (c) += 0xffff; > \ > } > \ > (c) -= (u_int16_t) *((u_int16_t *) (np)); > \ > if ((c) < 0) { > \ > (c) += 0xffff; > \ > } > \ > } while (0) > > it replaces the 16 bit word at *op with the new value at *np and updates > the > checksum c > > -- > __--_|\ Julian Elischer > / \ julian@elischer.org > ( OZ ) World tour 2000 > ---> X_.---._/ presently in: Budapest > v > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Budapest v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message