From d935e3abaf75a4cbc28e76d91ed597fcda5937fc Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 23 Oct 2019 13:49:24 +0000 Subject: 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@. --- src/usr.bin/nc/netcat.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 795592f0b7..711a49d247 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/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 * 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; - } } } -- cgit v1.2.3-55-g6feb