[2690] in Kerberos_V5_Development
Re: More Unicos porting hell (struct inaddr)
daemon@ATHENA.MIT.EDU (Ken Hornstein)
Fri Oct 31 13:59:23 1997
To: "Theodore Y. Ts'o" <tytso@MIT.EDU>
Cc: Assar Westerlund <assar@sics.se>, krbdev@MIT.EDU
In-Reply-To: Your message of "Wed, 29 Oct 1997 13:57:25 EST."
<199710291857.NAA13823@dcl.MIT.EDU>
Date: Fri, 31 Oct 1997 13:56:19 -0500
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
>That doesn't mean, though, that you shouldn't use the memcpy. In fact,
>the most generic way to write the code uses the generic form of the
>structure (i.e., struct sockaddr vs. struct sockaddr_in). My complaint
>was the Cray was rewarding folks who use the more non-portable form, and
>punishing folks that use the more portable form.
But, my changes still cause a memcpy() to be used. The question _I_
have is the use of the s_addr element of struct in_addr.
There is actually some code in Kerberos that just copies the address using
a pointer to struct in_addr. There is also some code that uses
in_addr.s_addr. Obviously, the former code has worked for a long time
on a bunch of systems.
I guess the question I have is what do people think about just using
a pointer to struct in_addr instead of a pointer to in_addr.s_addr.
That would be half of the work that needs to be done.
The _other_ half is to do something like:
#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.
Yes, this is heinous.
--Ken