Dag-Erling Smørgrav 31cfde7132 Like many other functions that handle sockaddrs, realhostname_sa() takes a
struct sockaddr * that it casts internally to the appropriate type based on
sa_family.  However, struct sockaddr has very lax alignment requirements,
which causes the compiler to complain when you cast a struct sockaddr * to,
say, a struct sockaddr_in6 *.

I find it reasonable to assume that the pointer we received is in fact
correctly aligned.  Therefore, we can work around the compiler warnings by
casting to void * before casting to the desired type.  For readability's
sake, this is done with macros.

The same technique should prove useful in other parts of the tree that
deal with socket addresses.

MFC after:	3 weeks
2008-11-05 12:13:10 +00:00
..
2007-09-28 15:31:44 +00:00
2007-09-28 15:31:44 +00:00
2008-10-17 21:21:14 +00:00
2008-11-04 13:50:50 +00:00