diff options
Diffstat (limited to 'patches/netcat.c.patch')
| -rw-r--r-- | patches/netcat.c.patch | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch index 89a4e43..fa05477 100644 --- a/patches/netcat.c.patch +++ b/patches/netcat.c.patch | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | --- apps/nc/netcat.c.orig Thu Jul 7 07:25:23 2016 | 1 | --- apps/nc/netcat.c.orig Sun Sep 4 05:37:35 2016 |
| 2 | +++ apps/nc/netcat.c Thu Jul 7 07:25:37 2016 | 2 | +++ apps/nc/netcat.c Sun Sep 4 05:40:24 2016 |
| 3 | @@ -91,9 +91,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 */ |
| 6 | int Oflag; /* TCP send buffer size */ | 6 | int Oflag; /* TCP send buffer size */ |
| @@ -14,7 +14,7 @@ | |||
| 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 | @@ -145,7 +149,7 @@ | 17 | @@ -146,7 +150,7 @@ |
| 18 | struct servent *sv; | 18 | struct servent *sv; |
| 19 | socklen_t len; | 19 | socklen_t len; |
| 20 | struct sockaddr_storage cliaddr; | 20 | struct sockaddr_storage cliaddr; |
| @@ -23,7 +23,7 @@ | |||
| 23 | const char *errstr, *proxyhost = "", *proxyport = NULL; | 23 | const char *errstr, *proxyhost = "", *proxyport = NULL; |
| 24 | struct addrinfo proxyhints; | 24 | struct addrinfo proxyhints; |
| 25 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; | 25 | char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; |
| 26 | @@ -255,12 +259,14 @@ | 26 | @@ -256,12 +260,14 @@ |
| 27 | case 'u': | 27 | case 'u': |
| 28 | uflag = 1; | 28 | uflag = 1; |
| 29 | break; | 29 | break; |
| @@ -38,7 +38,7 @@ | |||
| 38 | case 'v': | 38 | case 'v': |
| 39 | vflag = 1; | 39 | vflag = 1; |
| 40 | break; | 40 | break; |
| 41 | @@ -293,9 +299,11 @@ | 41 | @@ -294,9 +300,11 @@ |
| 42 | errx(1, "TCP send window %s: %s", | 42 | errx(1, "TCP send window %s: %s", |
| 43 | errstr, optarg); | 43 | errstr, optarg); |
| 44 | break; | 44 | break; |
| @@ -50,7 +50,7 @@ | |||
| 50 | case 'T': | 50 | case 'T': |
| 51 | errstr = NULL; | 51 | errstr = NULL; |
| 52 | errno = 0; | 52 | errno = 0; |
| 53 | @@ -319,9 +327,11 @@ | 53 | @@ -320,9 +328,11 @@ |
| 54 | argc -= optind; | 54 | argc -= optind; |
| 55 | argv += optind; | 55 | argv += optind; |
| 56 | 56 | ||
| @@ -62,17 +62,17 @@ | |||
| 62 | 62 | ||
| 63 | if (family == AF_UNIX) { | 63 | if (family == AF_UNIX) { |
| 64 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) | 64 | if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) |
| 65 | @@ -824,7 +834,10 @@ | 65 | @@ -825,7 +835,10 @@ |
| 66 | remote_connect(const char *host, const char *port, struct addrinfo hints) | 66 | remote_connect(const char *host, const char *port, struct addrinfo hints) |
| 67 | { | 67 | { |
| 68 | struct addrinfo *res, *res0; | 68 | struct addrinfo *res, *res0; |
| 69 | - int s, error, on = 1, save_errno; | 69 | - int s = -1, error, on = 1, save_errno; |
| 70 | + int s, error, save_errno; | 70 | + int s = -1, error, save_errno; |
| 71 | +#ifdef SO_BINDANY | 71 | +#ifdef SO_BINDANY |
| 72 | + int on = 1; | 72 | + int on = 1; |
| 73 | +#endif | 73 | +#endif |
| 74 | 74 | ||
| 75 | if ((error = getaddrinfo(host, port, &hints, &res))) | 75 | if ((error = getaddrinfo(host, port, &hints, &res0))) |
| 76 | errx(1, "getaddrinfo: %s", gai_strerror(error)); | 76 | errx(1, "getaddrinfo: %s", gai_strerror(error)); |
| 77 | @@ -839,8 +852,10 @@ | 77 | @@ -839,8 +852,10 @@ |
| 78 | if (sflag || pflag) { | 78 | if (sflag || pflag) { |
| @@ -83,22 +83,22 @@ | |||
| 83 | setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); | 83 | setsockopt(s, SOL_SOCKET, SO_BINDANY, &on, sizeof(on)); |
| 84 | +#endif | 84 | +#endif |
| 85 | memset(&ahints, 0, sizeof(struct addrinfo)); | 85 | memset(&ahints, 0, sizeof(struct addrinfo)); |
| 86 | ahints.ai_family = res0->ai_family; | 86 | ahints.ai_family = res->ai_family; |
| 87 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; | 87 | ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; |
| 88 | @@ -911,7 +926,10 @@ | 88 | @@ -911,7 +926,10 @@ |
| 89 | local_listen(char *host, char *port, struct addrinfo hints) | 89 | local_listen(char *host, char *port, struct addrinfo hints) |
| 90 | { | 90 | { |
| 91 | struct addrinfo *res, *res0; | 91 | struct addrinfo *res, *res0; |
| 92 | - int s, ret, x = 1, save_errno; | 92 | - int s = -1, ret, x = 1, save_errno; |
| 93 | + int s, save_errno; | 93 | + int s = -1, save_errno; |
| 94 | +#ifdef SO_REUSEPORT | 94 | +#ifdef SO_REUSEPORT |
| 95 | + int ret, x = 1; | 95 | + int ret, x = 1; |
| 96 | +#endif | 96 | +#endif |
| 97 | int error; | 97 | int error; |
| 98 | 98 | ||
| 99 | /* Allow nodename to be null. */ | 99 | /* Allow nodename to be null. */ |
| 100 | @@ -933,9 +951,11 @@ | 100 | @@ -932,9 +950,11 @@ |
| 101 | res0->ai_protocol)) < 0) | 101 | res->ai_protocol)) < 0) |
| 102 | continue; | 102 | continue; |
| 103 | 103 | ||
| 104 | +#ifdef SO_REUSEPORT | 104 | +#ifdef SO_REUSEPORT |
| @@ -107,9 +107,9 @@ | |||
| 107 | err(1, NULL); | 107 | err(1, NULL); |
| 108 | +#endif | 108 | +#endif |
| 109 | 109 | ||
| 110 | set_common_sockopts(s, res0->ai_family); | 110 | set_common_sockopts(s, res->ai_family); |
| 111 | 111 | ||
| 112 | @@ -1393,11 +1413,13 @@ | 112 | @@ -1392,11 +1412,13 @@ |
| 113 | { | 113 | { |
| 114 | int x = 1; | 114 | int x = 1; |
| 115 | 115 | ||
| @@ -123,7 +123,7 @@ | |||
| 123 | if (Dflag) { | 123 | if (Dflag) { |
| 124 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, | 124 | if (setsockopt(s, SOL_SOCKET, SO_DEBUG, |
| 125 | &x, sizeof(x)) == -1) | 125 | &x, sizeof(x)) == -1) |
| 126 | @@ -1434,13 +1456,17 @@ | 126 | @@ -1433,13 +1455,17 @@ |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | if (minttl != -1) { | 129 | if (minttl != -1) { |
| @@ -142,7 +142,7 @@ | |||
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | @@ -1597,14 +1623,22 @@ | 145 | @@ -1596,14 +1622,22 @@ |
| 146 | \t-P proxyuser\tUsername for proxy authentication\n\ | 146 | \t-P proxyuser\tUsername for proxy authentication\n\ |
| 147 | \t-p port\t Specify local port for remote connects\n\ | 147 | \t-p port\t Specify local port for remote connects\n\ |
| 148 | \t-R CAfile CA bundle\n\ | 148 | \t-R CAfile CA bundle\n\ |
