From 845ce56d7b5c52a071c842dc3a9a37aec0d305c0 Mon Sep 17 00:00:00 2001 From: shin Date: Sat, 29 Jan 2000 18:21:05 +0000 Subject: [PATCH] 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. git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@56870 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- telnet/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telnet/commands.c b/telnet/commands.c index dd83669..8380c29 100644 --- a/telnet/commands.c +++ b/telnet/commands.c @@ -2451,7 +2451,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';