aboutsummaryrefslogtreecommitdiff
path: root/patches/netcat.c.patch
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2018-11-07 20:00:29 -0600
committerBrent Cook <bcook@openbsd.org>2018-11-07 20:04:11 -0600
commit11bb39ecf6e58a5e44fc8043004b3f455f30b8fe (patch)
tree9845ff5edbb4cc370bb5f0ab9c4787668bd46f07 /patches/netcat.c.patch
parent34394e7ee024d2b88bed9c61b9a19bba6ec5e49e (diff)
downloadportable-11bb39ecf6e58a5e44fc8043004b3f455f30b8fe.tar.gz
portable-11bb39ecf6e58a5e44fc8043004b3f455f30b8fe.tar.bz2
portable-11bb39ecf6e58a5e44fc8043004b3f455f30b8fe.zip
Rediffed patches for merge fuzz
Diffstat (limited to 'patches/netcat.c.patch')
-rw-r--r--patches/netcat.c.patch32
1 files changed, 16 insertions, 16 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch
index 2965ea7..07205ec 100644
--- a/patches/netcat.c.patch
+++ b/patches/netcat.c.patch
@@ -1,5 +1,5 @@
1--- apps/nc/netcat.c.orig Mon Jul 17 06:06:51 2017 1--- apps/nc/netcat.c.orig 2018-11-07 17:01:38.000000000 -0600
2+++ apps/nc/netcat.c Mon Jul 17 06:11:24 2017 2+++ apps/nc/netcat.c 2018-11-07 17:37:57.000000000 -0600
3@@ -92,9 +92,13 @@ 3@@ -92,9 +92,13 @@
4 int Dflag; /* sodebug */ 4 int Dflag; /* sodebug */
5 int Iflag; /* TCP receive buffer size */ 5 int Iflag; /* TCP receive buffer size */
@@ -11,7 +11,7 @@
11+#ifdef SO_RTABLE 11+#ifdef SO_RTABLE
12 int rtableid = -1; 12 int rtableid = -1;
13+#endif 13+#endif
14 14
15 int usetls; /* use TLS */ 15 int usetls; /* use TLS */
16 char *Cflag; /* Public cert file */ 16 char *Cflag; /* Public cert file */
17@@ -266,12 +270,14 @@ 17@@ -266,12 +270,14 @@
@@ -44,13 +44,13 @@
44@@ -344,9 +352,11 @@ 44@@ -344,9 +352,11 @@
45 argc -= optind; 45 argc -= optind;
46 argv += optind; 46 argv += optind;
47 47
48+#ifdef SO_RTABLE 48+#ifdef SO_RTABLE
49 if (rtableid >= 0) 49 if (rtableid >= 0)
50 if (setrtable(rtableid) == -1) 50 if (setrtable(rtableid) == -1)
51 err(1, "setrtable"); 51 err(1, "setrtable");
52+#endif 52+#endif
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@@ -909,7 +919,10 @@ 56@@ -909,7 +919,10 @@
@@ -62,13 +62,13 @@
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@@ -924,8 +937,10 @@ 68@@ -924,8 +937,10 @@
69 if (sflag || pflag) { 69 if (sflag || pflag) {
70 struct addrinfo ahints, *ares; 70 struct addrinfo ahints, *ares;
71 71
72+#ifdef SO_BINDANY 72+#ifdef SO_BINDANY
73 /* try SO_BINDANY, but don't insist */ 73 /* try SO_BINDANY, but don't insist */
74 setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); 74 setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on));
@@ -86,24 +86,24 @@
86+ int ret, x = 1; 86+ int ret, x = 1;
87+#endif 87+#endif
88 int error; 88 int error;
89 89
90 /* Allow nodename to be null. */ 90 /* Allow nodename to be null. */
91@@ -1017,9 +1035,11 @@ 91@@ -1017,9 +1035,11 @@
92 res->ai_protocol)) < 0) 92 res->ai_protocol)) < 0)
93 continue; 93 continue;
94 94
95+#ifdef SO_REUSEPORT 95+#ifdef SO_REUSEPORT
96 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); 96 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
97 if (ret == -1) 97 if (ret == -1)
98 err(1, NULL); 98 err(1, NULL);
99+#endif 99+#endif
100 100
101 set_common_sockopts(s, res->ai_family); 101 set_common_sockopts(s, res->ai_family);
102 102
103@@ -1475,11 +1495,13 @@ 103@@ -1475,11 +1495,13 @@
104 { 104 {
105 int x = 1; 105 int x = 1;
106 106
107+#ifdef TCP_MD5SIG 107+#ifdef TCP_MD5SIG
108 if (Sflag) { 108 if (Sflag) {
109 if (setsockopt(s, IPPROTO_TCP, TCP_MD5SIG, 109 if (setsockopt(s, IPPROTO_TCP, TCP_MD5SIG,
@@ -117,7 +117,7 @@
117@@ -1490,9 +1512,16 @@ 117@@ -1490,9 +1512,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
121+#ifdef IPV6_TCLASS 121+#ifdef IPV6_TCLASS
122 else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, 122 else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
123 IPV6_TCLASS, &Tflag, sizeof(Tflag)) == -1) 123 IPV6_TCLASS, &Tflag, sizeof(Tflag)) == -1)
@@ -133,14 +133,14 @@
133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, 133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
134@@ -1516,13 +1545,17 @@ 134@@ -1516,13 +1545,17 @@
135 } 135 }
136 136
137 if (minttl != -1) { 137 if (minttl != -1) {
138+#ifdef IP_MINTTL 138+#ifdef IP_MINTTL
139 if (af == AF_INET && setsockopt(s, IPPROTO_IP, 139 if (af == AF_INET && setsockopt(s, IPPROTO_IP,
140 IP_MINTTL, &minttl, sizeof(minttl))) 140 IP_MINTTL, &minttl, sizeof(minttl)))
141 err(1, "set IP min TTL"); 141 err(1, "set IP min TTL");
142+#endif 142+#endif
143 143
144- else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, 144- else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
145+#ifdef IPV6_MINHOPCOUNT 145+#ifdef IPV6_MINHOPCOUNT
146+ if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, 146+ if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
@@ -149,7 +149,7 @@
149+#endif 149+#endif
150 } 150 }
151 } 151 }
152 152
153@@ -1748,14 +1781,22 @@ 153@@ -1748,14 +1781,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\