diff options
author | Goichi Hirakawa <gooichi@gyazsquare.com> | 2015-10-14 15:53:11 +0900 |
---|---|---|
committer | Goichi Hirakawa <gooichi@gyazsquare.com> | 2015-10-14 15:53:11 +0900 |
commit | 9dd9d1757eeb6ba0aec10e29f6350ad810de8d6d (patch) | |
tree | da2c58f74d341ce47457e425b14df8cb6cfc9837 | |
parent | ff52e6f4e36b6665fc867034e64051471876269f (diff) | |
download | portable-9dd9d1757eeb6ba0aec10e29f6350ad810de8d6d.tar.gz portable-9dd9d1757eeb6ba0aec10e29f6350ad810de8d6d.tar.bz2 portable-9dd9d1757eeb6ba0aec10e29f6350ad810de8d6d.zip |
update netcat.c.patch for osx 10.6 or earlier
-rw-r--r-- | patches/netcat.c.patch | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index fc61550..7200183 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch | |||
@@ -1,6 +1,17 @@ | |||
1 | --- apps/nc/netcat.c.orig Sun Sep 13 08:12:39 2015 | 1 | --- apps/nc/netcat.c.orig 2015-10-14 15:39:27.000000000 +0900 |
2 | +++ apps/nc/netcat.c Sun Sep 13 19:15:13 2015 | 2 | +++ apps/nc/netcat.c 2015-10-14 15:42:35.000000000 +0900 |
3 | @@ -98,9 +98,13 @@ | 3 | @@ -57,6 +57,10 @@ |
4 | #include <tls.h> | ||
5 | #include "atomicio.h" | ||
6 | |||
7 | +#ifndef IPV6_TCLASS | ||
8 | +#define IPV6_TCLASS -1 | ||
9 | +#endif | ||
10 | + | ||
11 | #define PORT_MAX 65535 | ||
12 | #define PORT_MAX_LEN 6 | ||
13 | #define UNIX_DG_TMP_SOCKET_SIZE 19 | ||
14 | @@ -93,9 +97,13 @@ | ||
4 | int Dflag; /* sodebug */ | 15 | int Dflag; /* sodebug */ |
5 | int Iflag; /* TCP receive buffer size */ | 16 | int Iflag; /* TCP receive buffer size */ |
6 | int Oflag; /* TCP send buffer size */ | 17 | int Oflag; /* TCP send buffer size */ |
@@ -14,7 +25,7 @@ | |||
14 | 25 | ||
15 | int usetls; /* use TLS */ | 26 | int usetls; /* use TLS */ |
16 | char *Cflag; /* Public cert file */ | 27 | char *Cflag; /* Public cert file */ |
17 | @@ -150,7 +154,7 @@ | 28 | @@ -145,7 +153,7 @@ |
18 | struct servent *sv; | 29 | struct servent *sv; |
19 | socklen_t len; | 30 | socklen_t len; |
20 | struct sockaddr_storage cliaddr; | 31 | struct sockaddr_storage cliaddr; |
@@ -23,7 +34,7 @@ | |||
23 | const char *errstr, *proxyhost = "", *proxyport = NULL; | 34 | const char *errstr, *proxyhost = "", *proxyport = NULL; |
24 | struct addrinfo proxyhints; | 35 | struct addrinfo proxyhints; |
25 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; | 36 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; |
26 | @@ -251,12 +255,14 @@ | 37 | @@ -246,12 +254,14 @@ |
27 | case 'u': | 38 | case 'u': |
28 | uflag = 1; | 39 | uflag = 1; |
29 | break; | 40 | break; |
@@ -38,7 +49,7 @@ | |||
38 | case 'v': | 49 | case 'v': |
39 | vflag = 1; | 50 | vflag = 1; |
40 | break; | 51 | break; |
41 | @@ -289,9 +295,11 @@ | 52 | @@ -284,9 +294,11 @@ |
42 | errx(1, "TCP send window %s: %s", | 53 | errx(1, "TCP send window %s: %s", |
43 | errstr, optarg); | 54 | errstr, optarg); |
44 | break; | 55 | break; |
@@ -50,7 +61,7 @@ | |||
50 | case 'T': | 61 | case 'T': |
51 | errstr = NULL; | 62 | errstr = NULL; |
52 | errno = 0; | 63 | errno = 0; |
53 | @@ -776,7 +784,10 @@ | 64 | @@ -771,7 +783,10 @@ |
54 | remote_connect(const char *host, const char *port, struct addrinfo hints) | 65 | remote_connect(const char *host, const char *port, struct addrinfo hints) |
55 | { | 66 | { |
56 | struct addrinfo *res, *res0; | 67 | struct addrinfo *res, *res0; |
@@ -62,7 +73,7 @@ | |||
62 | 73 | ||
63 | if ((error = getaddrinfo(host, port, &hints, &res))) | 74 | if ((error = getaddrinfo(host, port, &hints, &res))) |
64 | errx(1, "getaddrinfo: %s", gai_strerror(error)); | 75 | errx(1, "getaddrinfo: %s", gai_strerror(error)); |
65 | @@ -787,16 +798,20 @@ | 76 | @@ -782,16 +797,20 @@ |
66 | SOCK_NONBLOCK, res0->ai_protocol)) < 0) | 77 | SOCK_NONBLOCK, res0->ai_protocol)) < 0) |
67 | continue; | 78 | continue; |
68 | 79 | ||
@@ -83,7 +94,7 @@ | |||
83 | memset(&ahints, 0, sizeof(struct addrinfo)); | 94 | memset(&ahints, 0, sizeof(struct addrinfo)); |
84 | ahints.ai_family = res0->ai_family; | 95 | ahints.ai_family = res0->ai_family; |
85 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; | 96 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; |
86 | @@ -865,7 +880,10 @@ | 97 | @@ -860,7 +879,10 @@ |
87 | local_listen(char *host, char *port, struct addrinfo hints) | 98 | local_listen(char *host, char *port, struct addrinfo hints) |
88 | { | 99 | { |
89 | struct addrinfo *res, *res0; | 100 | struct addrinfo *res, *res0; |
@@ -95,7 +106,7 @@ | |||
95 | int error; | 106 | int error; |
96 | 107 | ||
97 | /* Allow nodename to be null. */ | 108 | /* Allow nodename to be null. */ |
98 | @@ -887,13 +905,17 @@ | 109 | @@ -882,13 +904,17 @@ |
99 | res0->ai_protocol)) < 0) | 110 | res0->ai_protocol)) < 0) |
100 | continue; | 111 | continue; |
101 | 112 | ||
@@ -113,7 +124,7 @@ | |||
113 | 124 | ||
114 | set_common_sockopts(s, res0->ai_family); | 125 | set_common_sockopts(s, res0->ai_family); |
115 | 126 | ||
116 | @@ -1337,11 +1359,13 @@ | 127 | @@ -1332,11 +1358,13 @@ |
117 | { | 128 | { |
118 | int x = 1; | 129 | int x = 1; |
119 | 130 | ||
@@ -127,7 +138,7 @@ | |||
127 | if (Dflag) { | 138 | if (Dflag) { |
128 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, | 139 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, |
129 | &x, sizeof(x)) == -1) | 140 | &x, sizeof(x)) == -1) |
130 | @@ -1516,15 +1540,19 @@ | 141 | @@ -1511,15 +1539,19 @@ |
131 | \t-P proxyuser\tUsername for proxy authentication\n\ | 142 | \t-P proxyuser\tUsername for proxy authentication\n\ |
132 | \t-p port\t Specify local port for remote connects\n\ | 143 | \t-p port\t Specify local port for remote connects\n\ |
133 | \t-R CAfile CA bundle\n\ | 144 | \t-R CAfile CA bundle\n\ |