summaryrefslogtreecommitdiff
path: root/usr.bin/nc
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2019-10-23 13:49:25 +0000
committerBob Beck <beck@cvs.openbsd.org>2019-10-23 13:49:25 +0000
commit4d6c2a96e91eadebb5073d8a4a76e6d5c3fcd5d9 (patch)
tree83c149351bbf63bdbce6c8504fd84c11559ece1e /usr.bin/nc
parent5d072d8a8a20f874c55ef25400a1cf8954730493 (diff)
Revert previous, which works for -N case but causes regress failures
for tls, since the socket is shut down without calling tls_close(). Since nc appears to have a problem with this in other shutdown() cases I am simply going to bake a new diff for this. noticed by bluhm@.
Diffstat (limited to 'usr.bin/nc')
-rw-r--r--usr.bin/nc/netcat.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index 795592f0b7e..711a49d2475 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.207 2019/10/17 14:29:24 beck Exp $ */
+/* $OpenBSD: netcat.c,v 1.208 2019/10/23 13:49:24 beck Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
* Copyright (c) 2015 Bob Beck. All rights reserved.
@@ -1259,23 +1259,6 @@ readwrite(int net_fd, struct tls *tls_ctx)
if (pfd[POLL_NETIN].fd == -1 && netinbufpos == 0) {
pfd[POLL_STDOUT].fd = -1;
}
-
- if (((usetls || Nflag) && (pfd[POLL_NETIN].fd == -1)) ||
- (usetls && pfd[POLL_NETOUT].fd == -1)) {
- /*
- * -N says: shutdown(2) the 'network socket'
- * after EOF on the input
- *
- * for TLS we need to die if either end is
- * toast, since both reading and writing to
- * the socket may be necessary for any higher
- * level tls operation
- */
- shutdown(pfd[POLL_NETOUT].fd, SHUT_WR);
- shutdown(pfd[POLL_NETIN].fd, SHUT_RD);
- pfd[POLL_NETOUT].fd = -1;
- pfd[POLL_NETIN].fd = -1;
- }
}
}