Date: Tue, 22 Aug 2000 03:20:04 -0700 (PDT) From: Peter Pentchev <roam@orbitel.bg> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/9982: inet_addr(3) should be return 32bit uint. Message-ID: <200008221020.DAA03548@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/9982; it has been noted by GNATS. From: Peter Pentchev <roam@orbitel.bg> To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: bin/9982: inet_addr(3) should be return 32bit uint. Date: Tue, 22 Aug 2000 13:13:09 +0300 On Tue, Aug 22, 2000 at 02:53:38AM -0700, johan@FreeBSD.org wrote: > Synopsis: inet_addr(3) should be return 32bit uint. > > State-Changed-From-To: open->feedback > State-Changed-By: johan > State-Changed-When: Tue Aug 22 02:50:32 PDT 2000 > State-Changed-Why: > Excuse my ignorance, by why should inet_addr return > a 32 bit unsigned int instead of unsigned long? > > I think the original poster was considering 32-bit IPv4 addresses, in which case the 64-bit ulong is indeed a bit of an overkill. Actually, IMHO a 64-bit value is precisely the wrong choice in any case - a bit too long for 32-bit IPv4 addresses, and quite a bit too short for 128-bit IPv6 addresses. True, nowhere in the inet_addr(3) manpage is it even implied that inet_addr() works correctly for the AF_INET6 family, but if it is an IPv4-only function, why the 64-bit return value? :) It is (mostly) harmless, yet there are cases when a picky (-Wall -W) compiler would complain about a 64-to-32 bit truncating. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008221020.DAA03548>