diff options
author | shin <shin@FreeBSD.org> | 2000-03-03 13:05:00 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-03-03 13:05:00 +0000 |
commit | 1b7dce690e9fb2a298fb1e3bedc8186e71b877a3 (patch) | |
tree | b5a56eafab2a9b9e971cc153059e5cf2c3910cc7 /lib/libc | |
parent | 2ce6961c1be143a79856f434b91fcfb88cab0f04 (diff) | |
download | FreeBSD-src-1b7dce690e9fb2a298fb1e3bedc8186e71b877a3.zip FreeBSD-src-1b7dce690e9fb2a298fb1e3bedc8186e71b877a3.tar.gz |
Replace structure copy form ifreq obtained by SIOCGIFADDR
to memcpy(), to avoid unaligned access trap on alpha.
Approved by: jkh
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/get_myaddress.c | 2 | ||||
-rw-r--r-- | lib/libc/rpc/pmap_rmt.c | 2 |
2 files changed, 2 insertions, 2 deletions
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; |