diff options
author | 1999-12-11 01:59:43 +0000 | |
---|---|---|
committer | 1999-12-11 01:59:43 +0000 | |
commit | 51a34b7611748b318af712ab4ee0383cacd7db6e (patch) | |
tree | 62e1c61a26582601204378495de7c6dcbd5fe951 | |
parent | simple driver for Texas Instruments TNETE2101 phy (diff) | |
download | wireguard-openbsd-51a34b7611748b318af712ab4ee0383cacd7db6e.tar.xz wireguard-openbsd-51a34b7611748b318af712ab4ee0383cacd7db6e.zip |
set "host" properly when getnameinfo() is successful.
-rw-r--r-- | libexec/telnetd/telnetd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index ae0a49b056e..9210a21480a 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: telnetd.c,v 1.19 1999/12/10 20:06:48 deraadt Exp $ */ +/* $OpenBSD: telnetd.c,v 1.20 1999/12/11 01:59:43 itojun Exp $ */ /* $NetBSD: telnetd.c,v 1.6 1996/03/20 04:25:57 tls Exp $ */ /* @@ -45,7 +45,7 @@ static char copyright[] = static char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95"; static char rcsid[] = "$NetBSD: telnetd.c,v 1.5 1996/02/28 20:38:23 thorpej Exp $"; #else -static char rcsid[] = "$OpenBSD: telnetd.c,v 1.19 1999/12/10 20:06:48 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: telnetd.c,v 1.20 1999/12/11 01:59:43 itojun Exp $"; #endif #endif /* not lint */ @@ -875,7 +875,9 @@ doit(who) (u_int)((utmp_len < 0) ? -utmp_len : utmp_len))) { host = hp->h_name; } else if (getnameinfo(who, who->sa_len, hbuf, sizeof(hbuf), NULL, 0, - NI_NUMERICHOST) != 0) { + NI_NUMERICHOST) == 0) { + host = hbuf; + } else { fatal(net, "getnameinfo"); } |