ISC dhcp server on NetBSD

Greg Troxel gdt at ir.bbn.com
Sat Apr 24 21:21:13 UTC 2004


  parse.c: In function `parse_lease_time':
  parse.c:425: warning: passing arg 1 of `ntohl' as unsigned due to
  prototype
  *** Error code 1

  Stop.
  make: stopped in /share/projects/dhcp/dhcp-3.0pl2/work.netbsd/common

  This error doesn't come up on the Linux compile. Best I can tell time_t
  is signed on both systems. Why the warning? I know this is relatively
  minor and I can remove "-Werror" to avoid it but I'd like some clarity.

I'd say that it is reasonable for ntohl to be unsigned, since a 32-bit
quantity in non-native byte order shouldn't be treated as signed
(which implies native byte order).  time_t might become 64 bits in the
future, too.

The code is really unpacking 32 bits in network order into *timep, and
then byteswapping it.  I suspect that if one uses a uint32_t for the
output of convert_num, and then passes that variable to ntohl all will
be ok.

On NetBSD/i386 1.6.2 and 2.0-beta, time_t is long, not 32 bits anyway.




More information about the dhcp-hackers mailing list