summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-11-11 04:45:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-11-11 04:45:45 +0000
commit0edee7c82a646eb1d7b12e367f4d6a88155cdb1f (patch)
tree134abc0ea1115a41f40c60be5ebc97b175f55de7 /sys/netinet
parentbb5d4d008b587d397c24d694cb8bc771520a7046 (diff)
align ifaliasreq.ifra_addr similar to the way that ifreq is fixed --
a gruesome union, to block the compiler from placing the struct incorrectly aligned on stack frames ok guenther
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_var.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index e87aee999f2..110ed7944c2 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_var.h,v 1.17 2011/10/13 18:23:40 claudio Exp $ */
+/* $OpenBSD: in_var.h,v 1.18 2012/11/11 04:45:44 deraadt Exp $ */
/* $NetBSD: in_var.h,v 1.16 1996/02/13 23:42:15 christos Exp $ */
/*
@@ -62,7 +62,13 @@ struct in_ifaddr {
struct in_aliasreq {
char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- struct sockaddr_in ifra_addr;
+ union {
+ struct sockaddr_in ifrau_addr;
+ int ifrau_align;
+ } ifra_ifrau;
+#ifndef ifra_addr
+#define ifra_addr ifra_ifrau.ifrau_addr
+#endif
struct sockaddr_in ifra_dstaddr;
#define ifra_broadaddr ifra_dstaddr
struct sockaddr_in ifra_mask;