From d1958c4a94b3ae2f24faeb8aa828d2065b36ee13 Mon Sep 17 00:00:00 2001 From: Donald Cooley Date: Sat, 8 Feb 2020 02:00:33 +0700 Subject: network/netcat-openbsd: Updated for version 1.206. Signed-off-by: Willy Sudiarto Raharjo --- .../patches/0007-udp-scan-timeout.patch | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'network/netcat-openbsd/patches/0007-udp-scan-timeout.patch') 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 --- -- cgit v1.2.3