Subject: Re: VAX code generation problem wrt IPSEC?
To: Johnny Billquist <>
From: Olaf Seibert <>
List: current-users
Date: 11/13/2001 01:39:58
On Mon 12 Nov 2001 at 14:36:59 +0100, Olaf Seibert wrote:
> #define ADDL    Asm("addl2 (%0)+,%1": "=r" (w), "=r" (sum): "0" (w), "1" (sum))
> #define ADWC    Asm("adwc  (%0)+,%1": "=r" (w), "=r" (sum): "0" (w), "1" (sum))

These changes do indeed fix the IP checksum problem.

However, the -O0 kernel has some problems left:

- savecore reports weird device numbers (can't find device 3536/854608)
- the output of netstat -s gives all nonsense numbers
- syslogd gives a weird signal number at shutdown time:
    exiting on signal 2147481512

so I'm sure there more things amiss.

Another thing: there is this comment in ns_cksum.c:

                 * We can do a 16 bit ones complement sum using
                 * 32 bit arithmetic registers for adding,
                 * with carries from the low added
                 * into the high (by normal carry-chaining)
                 * so long as we fold back before 16 carries have occured.

I'm pretty sure this is wrong, the 16 should be 2^16 I think, which is
rather different. This code and comment has apparently been more or less
unchanged through various 4.xBSD releases (back to 7.1 6/5/86 in

Does anybody have McKusick's cd set, which apparently has the SCCS files
for these things, so that we may find out who had this strange half
misunderstanding about how this works? (Unless it's me of course :-)

___ Olaf 'Rhialto' Seibert - rhialto@polder --They that can give up essential 
\X/ --liberty to purchase a little temporary safety
--------------deserve neither liberty or safety. - Benjamin Franklin, 1759