summaryrefslogtreecommitdiffstats
path: root/usr.bin/telnet
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-01-29 18:21:05 +0000
committershin <shin@FreeBSD.org>2000-01-29 18:21:05 +0000
commit3859c2231c300e924a06dba390e8f844141b24f4 (patch)
treea91f6d56620059169a59550275163b894034e611 /usr.bin/telnet
parent91ca8fff8641d6fec72ec0435a8c50aff02a411b (diff)
downloadFreeBSD-src-3859c2231c300e924a06dba390e8f844141b24f4.zip
FreeBSD-src-3859c2231c300e924a06dba390e8f844141b24f4.tar.gz
Add NI_NAMEREQD flag to getnameinfo() call. Without this flag,
getnameinfo() don't return error at name resolving failure. But it is used at doaddrlookup(-N) case in telnet, error need to be returned to correctly initialize hostname buffer. Discovered at checking recent KAME repository change, noticed by itojun.
Diffstat (limited to 'usr.bin/telnet')
-rw-r--r--usr.bin/telnet/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index a640bec..33a4548 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -2274,7 +2274,7 @@ tn(argc, argv)
if (doaddrlookup)
gni_err = getnameinfo(res->ai_addr, res->ai_addr->sa_len,
_hostname, sizeof(_hostname) - 1, NULL, 0,
- 0);
+ NI_NAMEREQD);
if (gni_err != 0)
(void) strncpy(_hostname, hostp, sizeof(_hostname) - 1);
_hostname[sizeof(_hostname)-1] = '\0';
OpenPOWER on IntegriCloud