summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-04-03 05:52:35 +0000
committerderaadt <deraadt@openbsd.org>1997-04-03 05:52:35 +0000
commit11fca95d3f3256b88499230bb1e4c120700491d6 (patch)
tree11bddb3e25780b54eb0b3c9839b8bf2ce612b7f2 /lib/libc
parent10 X's for mktemp() and mkstemp(). (diff)
downloadwireguard-openbsd-11fca95d3f3256b88499230bb1e4c120700491d6.tar.xz
wireguard-openbsd-11fca95d3f3256b88499230bb1e4c120700491d6.zip
ensure host_addr[] remains nicely aligned; pr#145, grr@shandakor.tharsis.com
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/gethostnamadr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index cfa58123540..e26ae989c50 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -52,7 +52,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.15 1997/04/02 08:22:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.16 1997/04/03 05:52:35 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -88,7 +88,11 @@ static char *__ypdomain;
static struct hostent host;
static char *host_aliases[MAXALIASES];
static char hostbuf[BUFSIZ+1];
-static u_char host_addr[16]; /* IPv4 or IPv6 */
+static union {
+ struct in_addr _host_in_addr;
+ u_char _host_addr[16]; /* IPv4 or IPv6 */
+} _host_addr_u;
+#define host_addr _host_addr_u._host_addr
static FILE *hostf = NULL;
static int stayopen = 0;