[2692] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: More Unicos porting hell (struct inaddr)

daemon@ATHENA.MIT.EDU (Ken Hornstein)
Fri Oct 31 17:14:00 1997

To: "Theodore Y. Ts'o" <tytso@MIT.EDU>
Cc: krbdev@MIT.EDU
In-Reply-To: Your message of "Fri, 31 Oct 1997 17:04:02 EST."
             <199710312204.RAA14681@dcl.MIT.EDU> 
Date: Fri, 31 Oct 1997 17:13:31 -0500
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>

>I just got some assurances from a colleague at work who serves as the
>Athena release engineer and who is also a NetBSD kernel developer, and
>he claims that we'd be safe using the address of the struct in_addr, as
>opposed to inaddr.s_addr.  A lot of code would break if that part of the
>API ever changed.

Okay, cool.

>   #ifndef SIZEOF_in_addr
>   #define SIZEOF_in_addr sizeof(struct in_addr)
>   #endif
>
>   and use SIZEOF_in_addr everywhere you needed the size of struct in_addr.
>
>Can you explain to me again why you need the above?

Sure.  In <netinet/in.h>, Cray does:

#define SIZEOF_in_addr	4

And all of the "Cray-friendly" code I've seen basically does the above
trick so only the first 4 bytes of the structure get copied (because
sizeof(struct in_addr) == 8 under Unicos).  So on non-Unicos machines,
the right thing happens (the "real" sizeof(struct in_addr) gets used),
and under Unicos, only the first 4 bytes are used.

Like I said ... a gross hack :-)

Oh, as for what Assar was talking about for writev ... I just wrote a
writev() function and put it into lib/krb5/posix.

--Ken

home help back first fref pref prev next nref lref last post