summaryrefslogtreecommitdiff
path: root/net/hping/patches/patch-aj
blob: 758d46f86c32cb19f8a76ee2a9745bcaaa4bac36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$NetBSD: patch-aj,v 1.1 2006/03/30 13:51:29 salo Exp $

--- send.c.orig	2003-08-01 16:53:08.000000000 +0200
+++ send.c	2005-11-05 21:46:21.000000000 +0100
@@ -79,9 +79,17 @@
 	else			send_tcp();
 
 	sent_pkt++;
-	Signal(SIGALRM, send_packet);
 
-	if (count != -1 && count == sent_pkt) { /* count reached? */
+	if (opt_flood) {
+		if (count != -1 && count <= sent_pkt) { /* count reached? */
+			print_statistics(0);
+		}
+		errno = errno_save;
+		return;
+	}
+
+	Signal(SIGALRM, send_packet);
+	if (count != -1 && count <= sent_pkt) { /* count reached? */
 		Signal(SIGALRM, print_statistics);
 		alarm(COUNTREACHED_TIMEOUT);
 	} else if (!opt_listenmode) {