summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Marie <semarie@cvs.openbsd.org>2016-01-30 05:38:27 +0000
committerSebastien Marie <semarie@cvs.openbsd.org>2016-01-30 05:38:27 +0000
commitc7ed55b273b7104a9fb3ceaffcb40364b0c45e03 (patch)
treed0fef7fd3221529d167e5a957d505498c9062237
parenta0511306bd37355d4d241a2d15c3ebdaffff541c (diff)
ping, ping6: corrects -E (audible beep when no packet is received before the
next packet is transmitted) regression with help and ok florian@
-rw-r--r--sbin/ping/ping.c14
-rw-r--r--sbin/ping6/ping6.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 93fc05da306..11003e946ae 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.137 2015/11/29 22:42:13 florian Exp $ */
+/* $OpenBSD: ping.c,v 1.138 2016/01/30 05:38:26 semarie Exp $ */
/* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */
/*
@@ -544,6 +544,12 @@ main(int argc, char *argv[])
if (seenalrm) {
retransmit();
seenalrm = 0;
+ if (ntransmitted - nreceived - 1 > nmissedmax) {
+ nmissedmax = ntransmitted - nreceived - 1;
+ if (!(options & F_FLOOD) &&
+ (options & F_AUD_MISS))
+ (void)fputc('\a', stderr);
+ }
continue;
}
if (seenint) {
@@ -591,12 +597,6 @@ main(int argc, char *argv[])
if (npackets && nreceived >= npackets)
break;
- if (ntransmitted - nreceived - 1 > nmissedmax) {
- nmissedmax = ntransmitted - nreceived - 1;
- if (!(options & F_FLOOD) && (options & F_AUD_MISS))
- (void)fputc('\a', stderr);
- }
-
}
summary(0);
exit(nreceived == 0);
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index 53682c829c7..fdada3e1ffc 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.144 2016/01/28 17:26:10 gsoares Exp $ */
+/* $OpenBSD: ping6.c,v 1.145 2016/01/30 05:38:26 semarie Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
@@ -641,6 +641,12 @@ main(int argc, char *argv[])
if (seenalrm) {
retransmit();
seenalrm = 0;
+ if (ntransmitted - nreceived - 1 > nmissedmax) {
+ nmissedmax = ntransmitted - nreceived - 1;
+ if (!(options & F_FLOOD) &&
+ (options & F_AUD_MISS))
+ (void)fputc('\a', stderr);
+ }
continue;
}
if (seenint) {
@@ -706,12 +712,6 @@ main(int argc, char *argv[])
}
if (npackets && nreceived >= npackets)
break;
- if (ntransmitted - nreceived - 1 > nmissedmax) {
- nmissedmax = ntransmitted - nreceived - 1;
- if (!(options & F_FLOOD) && (options & F_AUD_MISS))
- (void)fputc('\a', stderr);
- }
-
}
summary(0);
exit(nreceived == 0);