summaryrefslogtreecommitdiff
path: root/sbin/ping
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-02-05 04:56:48 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-02-05 04:56:48 +0000
commit7713a3bcbbea828c15e281bea77359367028be3a (patch)
treeef000571766b6d0be48f29e597c1ccaf471d12b0 /sbin/ping
parente4304eace8b67ee48757348d159d30924904e80a (diff)
Don't count DNS lookup time in ping -R. Problem noted by
Bill Fenner <fenner@FreeBSD.ORG>, fix from Theo <deraadt@openbsd.org>.
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index ea7d164f248..191d324970a 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.25 1997/08/06 01:45:24 deraadt Exp $ */
+/* $OpenBSD: ping.c,v 1.26 1998/02/05 04:56:47 millert 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.25 1997/08/06 01:45:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ping.c,v 1.26 1998/02/05 04:56:47 millert Exp $";
#endif
#endif /* not lint */
@@ -469,6 +469,7 @@ main(argc, argv)
struct sockaddr_in from;
register int cc;
int fromlen;
+ sigset_t omask, nmask;
if (options & F_FLOOD) {
pinger();
@@ -488,7 +489,11 @@ main(argc, argv)
perror("ping: recvfrom");
continue;
}
+ sigemptyset(&nmask);
+ sigaddset(&nmask, SIGALRM);
+ sigprocmask(SIG_BLOCK, &nmask, &omask);
pr_pack((char *)packet, cc, &from);
+ sigprocmask(SIG_SETMASK, &omask, NULL);
if (npackets && nreceived >= npackets)
break;
}