summaryrefslogtreecommitdiff
path: root/os/access.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2008-03-04 16:03:04 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2008-03-04 16:03:38 -0800
commitcf984dcc156958d4f8d98110e7add150628ce97e (patch)
tree2eac9ed32b83f8a3ef3615dbe6c5251b8bf99683 /os/access.c
parent27e7dacbf7ef17712be31ff90f98ee3a5c5cf909 (diff)
Make sure SIOGLIFCONF buffer is properly aligned for socket structures
Diffstat (limited to 'os/access.c')
-rw-r--r--os/access.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/os/access.c b/os/access.c
index e91dd37e4..db14380df 100644
--- a/os/access.c
+++ b/os/access.c
@@ -713,19 +713,21 @@ void
DefineSelf (int fd)
{
#ifndef HAS_GETIFADDRS
- char buf[2048], *cp, *cplim;
- void * bufptr = buf;
-#ifdef USE_SIOCGLIFCONF
+ char *cp, *cplim;
+# ifdef USE_SIOCGLIFCONF
+ struct sockaddr_storage buf[16];
struct lifconf ifc;
register struct lifreq *ifr;
-#ifdef SIOCGLIFNUM
+# ifdef SIOCGLIFNUM
struct lifnum ifn;
-#endif
-#else
+# endif
+# else /* !USE_SIOCGLIFCONF */
+ char buf[2048];
struct ifconf ifc;
register struct ifreq *ifr;
-#endif
-#else
+# endif
+ void * bufptr = buf;
+#else /* HAS_GETIFADDRS */
struct ifaddrs * ifap, *ifr;
#endif
int len;