diff options
| author | Brent Cook <bcook@openbsd.org> | 2017-06-03 20:13:25 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2017-06-03 20:13:25 -0500 |
| commit | 0974d6f011d10f2b32f2a2a8477530c3856f05ea (patch) | |
| tree | f1c169d07091df314b64f47a5953ae0b99952fd4 | |
| parent | d3f3daec18b9215f0e107f4f216b7873cd498b26 (diff) | |
| download | portable-0974d6f011d10f2b32f2a2a8477530c3856f05ea.tar.gz portable-0974d6f011d10f2b32f2a2a8477530c3856f05ea.tar.bz2 portable-0974d6f011d10f2b32f2a2a8477530c3856f05ea.zip | |
update nc patch
| -rw-r--r-- | patches/netcat.c.patch | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 4e75bc5..1088249 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | --- apps/nc/netcat.c.orig Thu Mar 16 19:26:06 2017 | 1 | --- apps/nc/netcat.c.orig Sat Jun 3 19:34:23 2017 |
| 2 | +++ apps/nc/netcat.c Sat Mar 25 11:17:36 2017 | 2 | +++ apps/nc/netcat.c Sat Jun 3 19:51:37 2017 |
| 3 | @@ -65,7 +65,9 @@ | 3 | @@ -65,7 +65,9 @@ |
| 4 | #define POLL_NETIN 2 | 4 | #define POLL_NETIN 2 |
| 5 | #define POLL_STDOUT 3 | 5 | #define POLL_STDOUT 3 |
| @@ -24,16 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | int usetls; /* use TLS */ | 25 | int usetls; /* use TLS */ |
| 26 | char *Cflag; /* Public cert file */ | 26 | char *Cflag; /* Public cert file */ |
| 27 | @@ -149,7 +155,7 @@ | 27 | @@ -264,12 +270,14 @@ |
| 28 | struct servent *sv; | ||
| 29 | socklen_t len; | ||
| 30 | struct sockaddr_storage cliaddr; | ||
| 31 | - char *proxy, *proxyport = NULL; | ||
| 32 | + char *proxy = NULL, *proxyport = NULL; | ||
| 33 | const char *errstr; | ||
| 34 | struct addrinfo proxyhints; | ||
| 35 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; | ||
| 36 | @@ -259,12 +265,14 @@ | ||
| 37 | case 'u': | 28 | case 'u': |
| 38 | uflag = 1; | 29 | uflag = 1; |
| 39 | break; | 30 | break; |
| @@ -48,7 +39,7 @@ | |||
| 48 | case 'v': | 39 | case 'v': |
| 49 | vflag = 1; | 40 | vflag = 1; |
| 50 | break; | 41 | break; |
| 51 | @@ -300,9 +308,11 @@ | 42 | @@ -316,9 +324,11 @@ |
| 52 | case 'o': | 43 | case 'o': |
| 53 | oflag = optarg; | 44 | oflag = optarg; |
| 54 | break; | 45 | break; |
| @@ -60,7 +51,7 @@ | |||
| 60 | case 'T': | 51 | case 'T': |
| 61 | errstr = NULL; | 52 | errstr = NULL; |
| 62 | errno = 0; | 53 | errno = 0; |
| 63 | @@ -326,9 +336,11 @@ | 54 | @@ -342,9 +352,11 @@ |
| 64 | argc -= optind; | 55 | argc -= optind; |
| 65 | argv += optind; | 56 | argv += optind; |
| 66 | 57 | ||
| @@ -72,7 +63,7 @@ | |||
| 72 | 63 | ||
| 73 | if (family == AF_UNIX) { | 64 | if (family == AF_UNIX) { |
| 74 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) | 65 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) |
| 75 | @@ -865,7 +877,10 @@ | 66 | @@ -889,7 +901,10 @@ |
| 76 | remote_connect(const char *host, const char *port, struct addrinfo hints) | 67 | remote_connect(const char *host, const char *port, struct addrinfo hints) |
| 77 | { | 68 | { |
| 78 | struct addrinfo *res, *res0; | 69 | struct addrinfo *res, *res0; |
| @@ -84,7 +75,7 @@ | |||
| 84 | 75 | ||
| 85 | if ((error = getaddrinfo(host, port, &hints, &res0))) | 76 | if ((error = getaddrinfo(host, port, &hints, &res0))) |
| 86 | errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, | 77 | errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, |
| 87 | @@ -880,8 +895,10 @@ | 78 | @@ -904,8 +919,10 @@ |
| 88 | if (sflag || pflag) { | 79 | if (sflag || pflag) { |
| 89 | struct addrinfo ahints, *ares; | 80 | struct addrinfo ahints, *ares; |
| 90 | 81 | ||
| @@ -95,7 +86,7 @@ | |||
| 95 | memset(&ahints, 0, sizeof(struct addrinfo)); | 86 | memset(&ahints, 0, sizeof(struct addrinfo)); |
| 96 | ahints.ai_family = res->ai_family; | 87 | ahints.ai_family = res->ai_family; |
| 97 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; | 88 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; |
| 98 | @@ -952,7 +969,10 @@ | 89 | @@ -976,7 +993,10 @@ |
| 99 | local_listen(char *host, char *port, struct addrinfo hints) | 90 | local_listen(char *host, char *port, struct addrinfo hints) |
| 100 | { | 91 | { |
| 101 | struct addrinfo *res, *res0; | 92 | struct addrinfo *res, *res0; |
| @@ -107,7 +98,7 @@ | |||
| 107 | int error; | 98 | int error; |
| 108 | 99 | ||
| 109 | /* Allow nodename to be null. */ | 100 | /* Allow nodename to be null. */ |
| 110 | @@ -973,9 +993,11 @@ | 101 | @@ -997,9 +1017,11 @@ |
| 111 | res->ai_protocol)) < 0) | 102 | res->ai_protocol)) < 0) |
| 112 | continue; | 103 | continue; |
| 113 | 104 | ||
| @@ -119,7 +110,7 @@ | |||
| 119 | 110 | ||
| 120 | set_common_sockopts(s, res->ai_family); | 111 | set_common_sockopts(s, res->ai_family); |
| 121 | 112 | ||
| 122 | @@ -1425,11 +1447,13 @@ | 113 | @@ -1455,11 +1477,13 @@ |
| 123 | { | 114 | { |
| 124 | int x = 1; | 115 | int x = 1; |
| 125 | 116 | ||
| @@ -133,7 +124,24 @@ | |||
| 133 | if (Dflag) { | 124 | if (Dflag) { |
| 134 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, | 125 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, |
| 135 | &x, sizeof(x)) == -1) | 126 | &x, sizeof(x)) == -1) |
| 136 | @@ -1466,13 +1490,17 @@ | 127 | @@ -1470,9 +1494,16 @@ |
| 128 | IP_TOS, &Tflag, sizeof(Tflag)) == -1) | ||
| 129 | err(1, "set IP ToS"); | ||
| 130 | |||
| 131 | +#ifdef IPV6_TCLASS | ||
| 132 | else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, | ||
| 133 | IPV6_TCLASS, &Tflag, sizeof(Tflag)) == -1) | ||
| 134 | err(1, "set IPv6 traffic class"); | ||
| 135 | +#else | ||
| 136 | + else if (af == AF_INET6) { | ||
| 137 | + errno = ENOPROTOOPT | ||
| 138 | + err(1, "set IPv6 traffic class not supported"); | ||
| 139 | + } | ||
| 140 | +#endif | ||
| 141 | } | ||
| 142 | if (Iflag) { | ||
| 143 | if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, | ||
| 144 | @@ -1496,13 +1527,17 @@ | ||
| 137 | } | 145 | } |
| 138 | 146 | ||
| 139 | if (minttl != -1) { | 147 | if (minttl != -1) { |
| @@ -152,7 +160,7 @@ | |||
| 152 | } | 160 | } |
| 153 | } | 161 | } |
| 154 | 162 | ||
| 155 | @@ -1666,14 +1694,22 @@ | 163 | @@ -1710,14 +1745,22 @@ |
| 156 | \t-P proxyuser\tUsername for proxy authentication\n\ | 164 | \t-P proxyuser\tUsername for proxy authentication\n\ |
| 157 | \t-p port\t Specify local port for remote connects\n\ | 165 | \t-p port\t Specify local port for remote connects\n\ |
| 158 | \t-R CAfile CA bundle\n\ | 166 | \t-R CAfile CA bundle\n\ |
| @@ -177,5 +185,5 @@ | |||
| 177 | +#endif | 185 | +#endif |
| 178 | + "\ | 186 | + "\ |
| 179 | \t-v Verbose\n\ | 187 | \t-v Verbose\n\ |
| 188 | \t-W recvlimit Terminate after receiving a number of packets\n\ | ||
| 180 | \t-w timeout Timeout for connects and final net reads\n\ | 189 | \t-w timeout Timeout for connects and final net reads\n\ |
| 181 | \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\ | ||
