diff options
author | Theo Buehler <tb@openbsd.org> | 2022-06-22 11:22:46 +0200 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2022-06-22 11:22:46 +0200 |
commit | fbe964e97b1ab8ac0f5293d98e1da2d1e6b23053 (patch) | |
tree | 833a9b07c5c5463ada9d5ae90c3fde49ddc58a82 /patches/netcat.c.patch | |
parent | b07c773ca8390c137043c62a5ccd5d876920e929 (diff) | |
download | portable-fbe964e97b1ab8ac0f5293d98e1da2d1e6b23053.tar.gz portable-fbe964e97b1ab8ac0f5293d98e1da2d1e6b23053.tar.bz2 portable-fbe964e97b1ab8ac0f5293d98e1da2d1e6b23053.zip |
Update netcat patch
Fixes #768
Diffstat (limited to 'patches/netcat.c.patch')
-rw-r--r-- | patches/netcat.c.patch | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 7d82aca..d21466a 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch | |||
@@ -1,5 +1,5 @@ | |||
1 | --- apps/nc/netcat.c.orig Sat Feb 15 11:04:42 2020 | 1 | --- apps/nc/netcat.c.orig Wed Jun 22 11:15:52 2022 |
2 | +++ apps/nc/netcat.c Sat Feb 15 11:24:38 2020 | 2 | +++ apps/nc/netcat.c Wed Jun 22 11:15:52 2022 |
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 */ |
@@ -53,7 +53,7 @@ | |||
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 (argc == 1 && family == AF_UNIX) { | 55 | if (argc == 1 && family == AF_UNIX) { |
56 | @@ -947,7 +957,10 @@ | 56 | @@ -945,7 +955,10 @@ |
57 | char *ipaddr) | 57 | char *ipaddr) |
58 | { | 58 | { |
59 | struct addrinfo *res, *res0; | 59 | struct addrinfo *res, *res0; |
@@ -65,7 +65,7 @@ | |||
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 | @@ -962,8 +975,10 @@ | 68 | @@ -960,8 +973,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 | @@ -1055,7 +1070,10 @@ | 79 | @@ -1053,7 +1068,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,7 +88,7 @@ | |||
88 | int error; | 88 | int error; |
89 | 89 | ||
90 | /* Allow nodename to be null. */ | 90 | /* Allow nodename to be null. */ |
91 | @@ -1076,9 +1094,11 @@ | 91 | @@ -1074,9 +1092,11 @@ |
92 | res->ai_protocol)) == -1) | 92 | res->ai_protocol)) == -1) |
93 | continue; | 93 | continue; |
94 | 94 | ||
@@ -100,21 +100,21 @@ | |||
100 | 100 | ||
101 | set_common_sockopts(s, res->ai_family); | 101 | set_common_sockopts(s, res->ai_family); |
102 | 102 | ||
103 | @@ -1548,11 +1568,13 @@ | 103 | @@ -1545,11 +1565,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, |
110 | &x, sizeof(x)) == -1) | 110 | &x, sizeof(x)) == -1) |
111 | err(1, NULL); | 111 | err(1, NULL); |
112 | } | 112 | } |
113 | +#endif | 113 | +#endif |
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 | @@ -1563,9 +1585,16 @@ | 117 | @@ -1560,9 +1582,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 | @@ -1589,13 +1618,17 @@ | 134 | @@ -1586,13 +1615,17 @@ |
135 | } | 135 | } |
136 | 136 | ||
137 | if (minttl != -1) { | 137 | if (minttl != -1) { |
@@ -150,7 +150,7 @@ | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | @@ -1820,15 +1853,19 @@ | 153 | @@ -1817,15 +1850,19 @@ |
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\ |