Subject: Re: ICMPv6 checksums on alpha
To: None <cjones@rupert.honors.montana.edu, port-alpha@netbsd.org>
From: Ross Harvey <ross@ghs.com>
List: tech-net
Date: 07/12/1999 13:01:05
>:::
> Jul 12 12:48:49 oleary /netbsd: ICMP6 checksum error(133|c5ff)
  fe80:0002::0a00:2bff:fee4:398c
>:::

It looks like this one was fixed yesterday.

Someone should really go through the netinet6 directory and change each
and every last long & u_long to one of int, size_t, ssize_t, one of the
network types, or one of the fixed width types.

Use of long is traditional in networking code, because (10 or 20 years ago)
a couple of stupid micros made `int' == `int16_t'. By tradition, and possibly
because htonl(3) and ntohl(3) keeps making people think `long', `long' was
used to ensure that the variable was 32 bits on all systems.

Nowdays, this tradition does no good, and is just a recurring source of
LP64 bugs. It's wierd how we can't seem to kill these off... :-)

Ironically, htonl(3) and ntohl(3) don't even take `long' as their argument
type!!! But the names were chosen in that unfortunate era and I think it
keeps protocol hackers using `long' in a very incorrect fashion these days.

If the maintainers want to use types available outside of netbsd, they
could use <sys/inttypes.h> which is a susv2-standardized header defining
susv2-standardized fixed-width types.  (Don't use the NetBSD inttypes.h as
a reference for the API. It only contains half of the types, because many
of them were already defined by our sys/types.h.)

The type names are: int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
uint32_t, and uint64_t. (The traditional BSD names are the same, except
u_*.)

	ross@netbsd.org