aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2019-10-27 09:28:56 -0500
committerBrent Cook <busterb@gmail.com>2019-10-27 09:28:56 -0500
commitf662008da6cfe9d697cb3ebf774473f66d098eb9 (patch)
tree3bb7c357b066ae87aed491e86437355981264279
parentb8d4bf79223e9d053e880168a68c7f14f0621a3c (diff)
downloadportable-f662008da6cfe9d697cb3ebf774473f66d098eb9.tar.gz
portable-f662008da6cfe9d697cb3ebf774473f66d098eb9.tar.bz2
portable-f662008da6cfe9d697cb3ebf774473f66d098eb9.zip
rebased netcat patch
-rw-r--r--patches/netcat.c.patch34
1 files changed, 17 insertions, 17 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch
index c06eb5b..f9c08ad 100644
--- a/patches/netcat.c.patch
+++ b/patches/netcat.c.patch
@@ -1,5 +1,5 @@
1--- apps/nc/netcat.c.orig Tue Mar 19 05:24:51 2019 1--- apps/nc/netcat.c.orig Sun Oct 27 09:22:15 2019
2+++ apps/nc/netcat.c Tue May 7 02:07:40 2019 2+++ apps/nc/netcat.c Sun Oct 27 09:24:17 2019
3@@ -93,9 +93,13 @@ 3@@ -93,9 +93,13 @@
4 int Dflag; /* sodebug */ 4 int Dflag; /* sodebug */
5 int Iflag; /* TCP receive buffer size */ 5 int Iflag; /* TCP receive buffer size */
@@ -14,7 +14,7 @@
14 14
15 int usetls; /* use TLS */ 15 int usetls; /* use TLS */
16 const char *Cflag; /* Public cert file */ 16 const char *Cflag; /* Public cert file */
17@@ -268,12 +272,14 @@ 17@@ -269,12 +273,14 @@
18 case 'u': 18 case 'u':
19 uflag = 1; 19 uflag = 1;
20 break; 20 break;
@@ -29,7 +29,7 @@
29 case 'v': 29 case 'v':
30 vflag = 1; 30 vflag = 1;
31 break; 31 break;
32@@ -320,9 +326,11 @@ 32@@ -321,9 +327,11 @@
33 case 'o': 33 case 'o':
34 oflag = optarg; 34 oflag = optarg;
35 break; 35 break;
@@ -41,7 +41,7 @@
41 case 'T': 41 case 'T':
42 errstr = NULL; 42 errstr = NULL;
43 errno = 0; 43 errno = 0;
44@@ -346,9 +354,11 @@ 44@@ -347,9 +355,11 @@
45 argc -= optind; 45 argc -= optind;
46 argv += optind; 46 argv += optind;
47 47
@@ -53,19 +53,19 @@
53 53
54 /* Cruft to make sure options are clean, and used properly. */ 54 /* Cruft to make sure options are clean, and used properly. */
55 if (argv[0] && !argv[1] && family == AF_UNIX) { 55 if (argv[0] && !argv[1] && family == AF_UNIX) {
56@@ -918,7 +928,10 @@ 56@@ -926,7 +936,10 @@
57 remote_connect(const char *host, const char *port, struct addrinfo hints) 57 char *ipaddr)
58 { 58 {
59 struct addrinfo *res, *res0; 59 struct addrinfo *res, *res0;
60- int s = -1, error, on = 1, save_errno; 60- int s = -1, error, herr, on = 1, save_errno;
61+ int s = -1, error, save_errno; 61+ int s = -1, error, herr, save_errno;
62+#ifdef SO_BINDANY 62+#ifdef SO_BINDANY
63+ int on = 1; 63+ int on = 1;
64+#endif 64+#endif
65 65
66 if ((error = getaddrinfo(host, port, &hints, &res0))) 66 if ((error = getaddrinfo(host, port, &hints, &res0)))
67 errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, 67 errx(1, "getaddrinfo for host \"%s\" port %s: %s", host,
68@@ -933,8 +946,10 @@ 68@@ -941,8 +954,10 @@
69 if (sflag || pflag) { 69 if (sflag || pflag) {
70 struct addrinfo ahints, *ares; 70 struct addrinfo ahints, *ares;
71 71
@@ -76,7 +76,7 @@
76 memset(&ahints, 0, sizeof(struct addrinfo)); 76 memset(&ahints, 0, sizeof(struct addrinfo));
77 ahints.ai_family = res->ai_family; 77 ahints.ai_family = res->ai_family;
78 ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; 78 ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
79@@ -1005,7 +1020,10 @@ 79@@ -1028,7 +1043,10 @@
80 local_listen(const char *host, const char *port, struct addrinfo hints) 80 local_listen(const char *host, const char *port, struct addrinfo hints)
81 { 81 {
82 struct addrinfo *res, *res0; 82 struct addrinfo *res, *res0;
@@ -88,8 +88,8 @@
88 int error; 88 int error;
89 89
90 /* Allow nodename to be null. */ 90 /* Allow nodename to be null. */
91@@ -1026,9 +1044,11 @@ 91@@ -1049,9 +1067,11 @@
92 res->ai_protocol)) < 0) 92 res->ai_protocol)) == -1)
93 continue; 93 continue;
94 94
95+#ifdef SO_REUSEPORT 95+#ifdef SO_REUSEPORT
@@ -100,7 +100,7 @@
100 100
101 set_common_sockopts(s, res->ai_family); 101 set_common_sockopts(s, res->ai_family);
102 102
103@@ -1498,11 +1518,13 @@ 103@@ -1521,11 +1541,13 @@
104 { 104 {
105 int x = 1; 105 int x = 1;
106 106
@@ -114,7 +114,7 @@
114 if (Dflag) { 114 if (Dflag) {
115 if (setsockopt(s, SOL_SOCKET, SO_DEBUG, 115 if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
116 &x, sizeof(x)) == -1) 116 &x, sizeof(x)) == -1)
117@@ -1513,9 +1535,16 @@ 117@@ -1536,9 +1558,16 @@
118 IP_TOS, &Tflag, sizeof(Tflag)) == -1) 118 IP_TOS, &Tflag, sizeof(Tflag)) == -1)
119 err(1, "set IP ToS"); 119 err(1, "set IP ToS");
120 120
@@ -131,7 +131,7 @@
131 } 131 }
132 if (Iflag) { 132 if (Iflag) {
133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, 133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
134@@ -1539,13 +1568,17 @@ 134@@ -1562,13 +1591,17 @@
135 } 135 }
136 136
137 if (minttl != -1) { 137 if (minttl != -1) {
@@ -150,7 +150,7 @@
150 } 150 }
151 } 151 }
152 152
153@@ -1767,14 +1800,22 @@ 153@@ -1790,14 +1823,22 @@
154 \t-P proxyuser\tUsername for proxy authentication\n\ 154 \t-P proxyuser\tUsername for proxy authentication\n\
155 \t-p port\t Specify local port for remote connects\n\ 155 \t-p port\t Specify local port for remote connects\n\
156 \t-R CAfile CA bundle\n\ 156 \t-R CAfile CA bundle\n\