pkgsrc/mail/postfix/patches/patch-bs
sommerfeld fb7661640c Avoid misaligned loads on alpha in util/inet_addr_local.c: copy *ifr in
such a way that gcc doesn't make unwarranted assumptions about the
alignment of *ifr.  Simply casting to (char *) wasn't sufficient.
2000-01-16 00:51:06 +00:00

22 lines
747 B
Text

$NetBSD: patch-bs,v 1.1 2000/01/16 00:51:07 sommerfeld Exp $
--- util/inet_addr_local.c.orig Fri Aug 27 08:08:43 1999
+++ util/inet_addr_local.c Sat Jan 15 17:41:30 2000
@@ -42,6 +42,7 @@
#include <sys/sockio.h>
#endif
#include <errno.h>
+#include <string.h>
/* Utility library. */
@@ -114,7 +115,8 @@
the_end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
for (ifr = ifc.ifc_req; ifr < the_end;) {
if (ifr->ifr_addr.sa_family == AF_INET) { /* IP interface */
- ifreq = *ifr;
+ char *ifrp = (char *)ifr;
+ memcpy(&ifreq, ifrp, sizeof(*ifr));
if (ioctl(sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
msg_fatal("%s: ioctl SIOCGIFFLAGS: %m", myname);
if (ifreq.ifr_flags & IFF_UP) { /* active interface */