From 1b7dce690e9fb2a298fb1e3bedc8186e71b877a3 Mon Sep 17 00:00:00 2001 From: shin Date: Fri, 3 Mar 2000 13:05:00 +0000 Subject: Replace structure copy form ifreq obtained by SIOCGIFADDR to memcpy(), to avoid unaligned access trap on alpha. Approved by: jkh --- lib/libc/rpc/get_myaddress.c | 2 +- lib/libc/rpc/pmap_rmt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libc/rpc/get_myaddress.c b/lib/libc/rpc/get_myaddress.c index 05fae48..eb2917e 100644 --- a/lib/libc/rpc/get_myaddress.c +++ b/lib/libc/rpc/get_myaddress.c @@ -81,7 +81,7 @@ again: end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); while (ifr < end) { - ifreq = *ifr; + memcpy(&ifreq, ifr, sizeof(ifreq)); if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) { _close(s); return(-1); diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index 55ddef9..f36acf1 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -189,7 +189,7 @@ getbroadcastnets(addrs, sock, buf) ifr = (struct ifreq *)cp; if (ifr->ifr_addr.sa_family != AF_INET) continue; - ifreq = *ifr; + memcpy(&ifreq, ifr, sizeof(ifreq)); if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifreq) < 0) { perror("broadcast: ioctl (get interface flags)"); continue; -- cgit v1.1