From 127024533874d33a814299a400ef47fe8790e00e Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 5 Aug 2024 07:16:30 +0000 Subject: [PATCH] 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 --- usr.bin/nc/netcat.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index 856a01c2b44..a25c4f175ae 100644 --- a/usr.bin/nc/netcat.c +++ b/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; -- 2.20.1