diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-16 05:57:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-16 05:57:47 +0000 |
commit | d0f99ca40e66e3702d66ff73b564795d1d9b9644 (patch) | |
tree | d09c0bb1732cb2bb4bfaef8645821427c6a60802 /sbin/ping | |
parent | 88f5ff6fa7615861b460a9102a4f2fe5cdfb3a47 (diff) |
put time in network byte order. I thought I fixed this!
Diffstat (limited to 'sbin/ping')
-rw-r--r-- | sbin/ping/ping.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 38e80cb6497..7fd72292786 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.32 1998/05/16 05:52:36 deraadt Exp $ */ +/* $OpenBSD: ping.c,v 1.33 1998/05/16 05:57:46 deraadt Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$OpenBSD: ping.c,v 1.32 1998/05/16 05:52:36 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ping.c,v 1.33 1998/05/16 05:57:46 deraadt Exp $"; #endif #endif /* not lint */ @@ -581,8 +581,8 @@ pinger() struct tvi tvi; (void)gettimeofday(&tv, (struct timezone *)NULL); - tvi.tv_sec = tv.tv_sec; - tvi.tv_usec = tv.tv_usec; + tvi.tv_sec = htonl(tv.tv_sec); + tvi.tv_usec = htonl(tv.tv_usec); memcpy((u_int *)&outpack[8], &tvi, sizeof tvi); } @@ -666,8 +666,8 @@ pr_pack(buf, cc, from) pkttime = (char *)icp->icmp_data; #endif memcpy(&tvi, pkttime, sizeof tvi); - tp.tv_sec = tvi.tv_sec; - tp.tv_usec = tvi.tv_usec; + tp.tv_sec = ntohl(tvi.tv_sec); + tp.tv_usec = ntohl(tvi.tv_usec); timersub(&tv, &tp, &tv); triptime = (tv.tv_sec * 1000000) + tv.tv_usec; |