diff options
author | jb <jb@FreeBSD.org> | 1998-06-06 23:33:28 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-06-06 23:33:28 +0000 |
commit | e886c0d520510b5802f18292d53cd24fd79280a7 (patch) | |
tree | 5e7e8db4d723b7844f7c7ee4fa791465e0a4caac /sbin/ping/ping.c | |
parent | f9217c4bf11830500885c68788669caee49b6c4e (diff) | |
download | FreeBSD-src-e886c0d520510b5802f18292d53cd24fd79280a7.zip FreeBSD-src-e886c0d520510b5802f18292d53cd24fd79280a7.tar.gz |
Fix an alignment problem on alpha by doing a bytewise copy.
Diffstat (limited to 'sbin/ping/ping.c')
-rw-r--r-- | sbin/ping/ping.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 23eda9f..a7b2ed1 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -45,7 +45,7 @@ static const char copyright[] = static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; */ static const char rcsid[] = - "$Id: ping.c,v 1.36 1998/05/25 06:53:17 steve Exp $"; + "$Id: ping.c,v 1.37 1998/05/25 20:16:05 fenner Exp $"; #endif /* not lint */ /* @@ -526,8 +526,11 @@ main(argc, argv) #ifdef SO_TIMESTAMP if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_TIMESTAMP && - cmsg->cmsg_len == (sizeof *cmsg + sizeof *t)) - t = (struct timeval *)CMSG_DATA(cmsg); + cmsg->cmsg_len == (sizeof *cmsg + sizeof *t)) { + /* Copy to avoid alignment problems: */ + memcpy(&now,CMSG_DATA(cmsg),sizeof(now)); + t = &now; + } #endif if (t == 0) { (void)gettimeofday(&now, NULL); |