aboutsummaryrefslogtreecommitdiff
path: root/network/netcat-openbsd/patches/0007-udp-scan-timeout.patch
diff options
context:
space:
mode:
authorDonald Cooley <chytraeus@protonmail.com>2020-02-08 02:00:33 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-02-08 02:00:33 +0700
commitd1958c4a94b3ae2f24faeb8aa828d2065b36ee13 (patch)
tree11ce09c8e8aa00f7122923cf830a8f807d0ac328 /network/netcat-openbsd/patches/0007-udp-scan-timeout.patch
parent960bca1643f56ff4393a9339847467a8f8a7c361 (diff)
network/netcat-openbsd: Updated for version 1.206.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/netcat-openbsd/patches/0007-udp-scan-timeout.patch')
-rw-r--r--network/netcat-openbsd/patches/0007-udp-scan-timeout.patch22
1 files changed, 9 insertions, 13 deletions
diff --git a/network/netcat-openbsd/patches/0007-udp-scan-timeout.patch b/network/netcat-openbsd/patches/0007-udp-scan-timeout.patch
index c63775a495..85cd186cce 100644
--- a/network/netcat-openbsd/patches/0007-udp-scan-timeout.patch
+++ b/network/netcat-openbsd/patches/0007-udp-scan-timeout.patch
@@ -3,23 +3,21 @@ Date: Mon, 13 Feb 2012 15:29:37 +0800
Subject: udp scan timeout
---
- netcat.c | 25 ++++++++++++++++---------
- 1 file changed, 16 insertions(+), 9 deletions(-)
+ netcat.c | 23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
-diff --git a/netcat.c b/netcat.c
-index 29ecf1a..baab909 100644
--- a/netcat.c
+++ b/netcat.c
-@@ -111,6 +111,8 @@
+@@ -129,6 +129,8 @@
#define CONNECTION_FAILED 1
#define CONNECTION_TIMEOUT 2
+#define UDP_SCAN_TIMEOUT 3 /* Seconds */
+
/* Command Line Options */
- int Cflag = 0; /* CRLF line-ending */
int dflag; /* detached, no stdin */
-@@ -497,7 +499,7 @@ main(int argc, char *argv[])
+ int Fflag; /* fdpass sock to stdout */
+@@ -823,7 +825,7 @@ main(int argc, char *argv[])
continue;
ret = 0;
@@ -28,19 +26,18 @@ index 29ecf1a..baab909 100644
/* For UDP, make sure we are connected. */
if (uflag) {
if (udptest(s) == -1) {
-@@ -1057,15 +1059,20 @@ build_ports(char *p)
+@@ -1768,15 +1770,20 @@ build_ports(char *p)
int
udptest(int s)
{
- int i, ret;
--
++ int i, t;
+
- for (i = 0; i <= 3; i++) {
- if (write(s, "X", 1) == 1)
- ret = 1;
- else
- ret = -1;
-+ int i, t;
-+
+ if ((write(s, "X", 1) != 1) ||
+ ((write(s, "X", 1) != 1) && (errno == ECONNREFUSED)))
+ return -1;
@@ -52,9 +49,8 @@ index 29ecf1a..baab909 100644
+ if ((write(s, "X", 1) != 1) && (errno == ECONNREFUSED))
+ return -1;
}
-- return (ret);
+- return ret;
+ return 1;
}
void
---