diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2012-12-23 11:48:30 +0100 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-11-06 00:57:03 -0600 |
commit | b49d0a636b226866bf9a19bbea02d9714bcaef2c (patch) | |
tree | 8c0aad35e0335b20dd49ae1a1b71689c35381045 /network/netcat-openbsd/patches/0010-serialized-handling-multiple-clients.patch | |
parent | 36b9d2ef47a33d7cfb19879dca67f3250a4c2b4e (diff) | |
download | slackbuilds-b49d0a636b226866bf9a19bbea02d9714bcaef2c.tar.gz |
network/netcat-openbsd: Updated for version 1.105 (from Debian).
Apply the patches locally and added a note
about this package being incompatible with nc from Slackware
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'network/netcat-openbsd/patches/0010-serialized-handling-multiple-clients.patch')
-rw-r--r-- | network/netcat-openbsd/patches/0010-serialized-handling-multiple-clients.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/network/netcat-openbsd/patches/0010-serialized-handling-multiple-clients.patch b/network/netcat-openbsd/patches/0010-serialized-handling-multiple-clients.patch new file mode 100644 index 0000000000..0d3ea68b96 --- /dev/null +++ b/network/netcat-openbsd/patches/0010-serialized-handling-multiple-clients.patch @@ -0,0 +1,75 @@ +From: Aron Xu <aron@debian.org> +Date: Tue, 14 Feb 2012 23:02:00 +0800 +Subject: serialized handling multiple clients + +--- + netcat.c | 39 +++++++++++++++++++-------------------- + 1 file changed, 19 insertions(+), 20 deletions(-) + +diff --git a/netcat.c b/netcat.c +index 56cc15e..bf9940f 100644 +--- a/netcat.c ++++ b/netcat.c +@@ -447,26 +447,24 @@ main(int argc, char *argv[]) + s = unix_bind(host); + else + s = unix_listen(host); +- } ++ } else ++ s = local_listen(host, uport, hints); ++ if (s < 0) ++ err(1, NULL); ++ ++ char* local; ++ if (family == AF_INET6) ++ local = ":::"; ++ else ++ local = "0.0.0.0"; ++ fprintf(stderr, "Listening on [%s] (family %d, port %d)\n", ++ host ?: local, ++ family, ++ *uport); + + /* Allow only one connection at a time, but stay alive. */ + for (;;) { +- if (family != AF_UNIX) +- s = local_listen(host, uport, hints); +- if (s < 0) +- err(1, NULL); + +- char* local; +- if (family == AF_INET6 ) +- local = "0.0.0.0"; +- else if (family == AF_INET) +- local = ":::"; +- else +- local = "unknown"; +- fprintf(stderr, "Listening on [%s] (family %d, port %d)\n", +- host ?: local, +- family, +- *uport); + /* + * For UDP, we will use recvfrom() initially + * to wait for a caller, then use the regular +@@ -536,15 +534,16 @@ main(int argc, char *argv[]) + close(connfd); + } + +- if (family != AF_UNIX) ++ if (kflag) ++ continue; ++ if (family != AF_UNIX) { + close(s); ++ } + else if (uflag) { + if (connect(s, NULL, 0) < 0) + err(1, "connect"); + } +- +- if (!kflag) +- break; ++ break; + } + } else if (family == AF_UNIX) { + ret = 0; +-- |