Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2001 16:51:29 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Erik Trulsson <ertr1013@student.uu.se>
Cc:        hackers@FreeBSD.org
Subject:   Re: Ok, who broke timed?
Message-ID:  <XFMail.011119165129.jhb@FreeBSD.org>
In-Reply-To: <20011120003613.GA29465@student.uu.se>

next in thread | previous in thread | raw e-mail | index | archive | help

On 20-Nov-01 Erik Trulsson wrote:
> On Mon, Nov 19, 2001 at 03:06:28PM -0800, John Baldwin wrote:
>> Does timed have some major 64 bit issues or something?  Trying to run timed
>> on
>> my 5.0 alpha from a 4.4 x86 box proves disastrous.  5.0 x86 clients work
>> fine. 
>> The alpha keeps getting its date set back into 1970:
> 
> After quick look at the source I would say that timed has some major 64
> bit issues.  
> As far as I can tell timed sends/receives a 'struct tsp' after
> adjusting it for byteorder but not for wordsize.  This struct is
> defined in <protocols/timed.h> as
> 
> struct tsp {
>         u_char  tsp_type;
>         u_char  tsp_vers;
>         u_short tsp_seq;
>         union {
>                 struct timeval tspu_time;
>                 char tspu_hopcnt;
>         } tsp_u;
>         char tsp_name[MAXHOSTNAMELEN];
> };
> 
> and struct timeval is defined in <sys/time.h> as
> 
> struct timeval {
>         long    tv_sec;         /* seconds */
>         long    tv_usec;        /* and microseconds */
> };

That looks very promising indeed.  Hrmm.  I should go see if NetBSD has fixed
this.  I guess having timeval be different sizes on different archs is a bit of
a pain. :(  Perhaps it should use uint32_t?  Or perhaps struct tsp should use
its own variant of timeval with uint32_t or some such.  Ugh.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.011119165129.jhb>