64-bit time_t safe lease time
des at des.no
Mon Jun 28 04:20:54 PDT 2004
Joerg Wunsch <j at ida.interface-business.de> writes:
> The problem was that GET_TIME() (first called in script_go())
> clobbered part of sockaddr_broadcast. The memory area it clobbers
> looks a bit surprising to me, but the actual error became obvious
> then: calling time() on a TIME* object, when sizeof(time_t) !=
> sizeof(TIME) is just an error.
your analysis does not jibe with my reading of the code, since TIME is
defined as time_t:
#define TIME time_t
#define GET_TIME(x) time ((x))
there's nothing wrong with this as long as the argument to GET_TIME()
is always a TIME (or time_t). GET_TIME() is called in three places,
always with &cur_time as argument. cur_time is defined as a TIME in
dhclient, and redefined as an int32_t in libomapip (which is linked
statically into dhclient). The fact that it is defined twice is
probably a bug; the fact that the linker does not warn about this is
probably a bug, too.
The attached patch addresses these inconsistencies, but I have not
verified that it corrects the 64-bit time_t problem.
Dag-Erling Smørgrav - des at des.no
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2040 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-sparc64/attachments/20040628/41a50e32/cur_time.bin
More information about the freebsd-sparc64