Files
netcat-openbsd/make-getnameinfo-errors-nonfatal-in-report_sock.patch

31 lines
872 B
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From: Guilhem Moulin <guilhem@debian.org>
Date: Fri, 5 Jun 2020 03:11:21 +0200
Subject: Make getnameinfo(3) errors non-fatal in report_sock()
report_sock() is used to show the peer's address/name and port when the
-v flag is set. Reverse resolution errors need not be fatal.
Bug-Debian: https://bugs.debian.org/961378
---
netcat.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/netcat.c b/netcat.c
index 0caba28..061a774 100644
--- a/netcat.c
+++ b/netcat.c
@@ -2220,9 +2220,11 @@ report_sock(const char *msg, const struct sockaddr *sa, socklen_t salen,
case 0:
break;
case EAI_SYSTEM:
- err(1, "getnameinfo");
+ warn("getnameinfo");
+ return;
default:
- errx(1, "getnameinfo: %s", gai_strerror(herr));
+ warnx("getnameinfo: %s", gai_strerror(herr));
+ return;
}
fprintf(stderr, "%s on %s %s\n", msg, host, port);