Subject: UT_HOSTSIZE vs. MAXHOSTNAMELEN
To: None <current-users@netbsd.org>
From: Brian Stark <bstark@siemens-psc.com>
List: current-users
Date: 10/01/1999 15:48:05
Hello,
Does anyone know why the value for UT_HOSTSIZE (defined as 16 in
/usr/include/utmp.h) does not match the value for MAXHOSTNAMELEN
(defined as 256 in /usr/include/sys/param.h)? UT_HOSTSIZE is used
in the data structure that describes the entries in /var/log/wtmp.
IMHO, it would make sense to have this constant be the same as
MAXHOSTNAMELEN.
I'm thinking that the value of 16 may have something to do with the
amount of space required to store an IPv4 address as a C-style string.
For example the IP address string:
123.123.123.123
requires 15 characters, plus one extra character for the null terminator
so 16 characters seems to make sense...
But now there is IPv6 support already in -current or going into
-current, and those IP address strings can be longer than what fits
into an array sized at UT_HOSTSIZE characters.
I think UT_HOSTSIZE needs to be increased. Comments anyone?
Brian
-------------------------------------------------------------------------
| Brian Stark | Internet : bstark@siemens-psc.com |
| Siemens PT&D, LLC | Voice : +1 612 536-4697 |
| Power Systems Control Division | Fax : +1 612 536-4919 |
| 7225 Northland Drive, Brooklyn Park, Minnesota 55428 USA |
-------------------------------------------------------------------------