From a6a88f9bd8328ce2e9ea13e316379f5f3ab485ea Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 5 Aug 2024 07:16:30 +0000 Subject: Remove bogus connect(s, NULL, 0) call The only thing it does is error because of a check added in sockargs() in uipc_syscalls r1.155. As guenther pointed out, this may have been added because of a misreading of the last sentence of the first paragraph of the connect(2) manual. Instead of erroring, this will keep listening if -k is given and otherwise it will close the socket and exit with success. ok guenther jeremy --- src/usr.bin/nc/netcat.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 856a01c2b4..a25c4f175a 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.227 2024/08/02 21:08:47 jan Exp $ */ +/* $OpenBSD: netcat.c,v 1.228 2024/08/05 07:16:30 tb Exp $ */ /* * Copyright (c) 2001 Eric Jackson * Copyright (c) 2015 Bob Beck. All rights reserved. @@ -644,10 +644,6 @@ main(int argc, char *argv[]) close(connfd); tls_free(tls_cctx); } - if (family == AF_UNIX && uflag) { - if (connect(s, NULL, 0) == -1) - err(1, "connect"); - } if (!kflag) break; -- cgit v1.2.3-55-g6feb