summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/nc/netcat.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c
index dc60158749..3ee1670053 100644
--- a/src/usr.bin/nc/netcat.c
+++ b/src/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: netcat.c,v 1.223 2022/12/18 12:51:10 tb Exp $ */ 1/* $OpenBSD: netcat.c,v 1.224 2022/12/18 12:53:18 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> 3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
4 * Copyright (c) 2015 Bob Beck. All rights reserved. 4 * Copyright (c) 2015 Bob Beck. All rights reserved.
@@ -700,16 +700,19 @@ main(int argc, char *argv[])
700 700
701 ret = 0; 701 ret = 0;
702 if (vflag || zflag) { 702 if (vflag || zflag) {
703 int print_info = 1;
704
703 /* For UDP, make sure we are connected. */ 705 /* For UDP, make sure we are connected. */
704 if (uflag) { 706 if (uflag) {
705 if (udptest(s) == -1) { 707 /* No info on failed or skipped test. */
708 if ((print_info = udptest(s)) == -1) {
706 ret = 1; 709 ret = 1;
707 continue; 710 continue;
708 } 711 }
709 } 712 }
710 713 if (print_info == 1)
711 connection_info(host, portlist[i], 714 connection_info(host, portlist[i],
712 uflag ? "udp" : "tcp", ipaddr); 715 uflag ? "udp" : "tcp", ipaddr);
713 } 716 }
714 if (Fflag) 717 if (Fflag)
715 fdpass(s); 718 fdpass(s);