[sshconnect.c]
     always use getnameinfo.  (diag message only)
This commit is contained in:
Ben Lindstrom 2002-06-09 20:14:54 +00:00
parent 2e17b08e48
commit 159ac2e8cd
2 changed files with 8 additions and 15 deletions

View File

@ -22,6 +22,9 @@
[readconf.c]
silently ignore deprecated options, since FallBackToRsh might be passed
by remote scp commands.
- itojun@cvs.openbsd.org 2002/06/08 21:15:27
[sshconnect.c]
always use getnameinfo. (diag message only)
20020607
- (bal) Removed --{enable/disable}-suid-ssh
@ -853,4 +856,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
$Id: ChangeLog,v 1.2195 2002/06/09 20:13:27 mouring Exp $
$Id: ChangeLog,v 1.2196 2002/06/09 20:14:54 mouring Exp $

View File

@ -13,7 +13,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: sshconnect.c,v 1.120 2002/05/23 19:24:30 markus Exp $");
RCSID("$OpenBSD: sshconnect.c,v 1.121 2002/06/08 21:15:27 itojun Exp $");
#include <openssl/bn.h>
@ -46,21 +46,11 @@ extern char *__progname;
static const char *
sockaddr_ntop(struct sockaddr *sa)
{
void *addr;
static char addrbuf[INET6_ADDRSTRLEN];
static char addrbuf[NI_MAXHOST];
switch (sa->sa_family) {
case AF_INET:
addr = &((struct sockaddr_in *)sa)->sin_addr;
break;
case AF_INET6:
addr = &((struct sockaddr_in6 *)sa)->sin6_addr;
break;
default:
/* This case should be protected against elsewhere */
if (getnameinfo(sa, sa->sa_len, addrbuf, sizeof(addrbuf), NULL, 0,
NI_NUMERICHOST) != 0)
abort(); /* XXX abort is bad -- do something else */
}
inet_ntop(sa->sa_family, addr, addrbuf, sizeof(addrbuf));
return addrbuf;
}