diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-11 17:46:34 +0200 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-11 17:46:34 +0200 |
commit | 18a32a7efa9ca967bf1ca2b55a6543c180aceaeb (patch) | |
tree | 4aec9f4924ea8566ebda9346088253abe23d1295 | |
parent | - stevesk@cvs.openbsd.org 2002/06/09 22:15:15 (diff) | |
download | openssh-18a32a7efa9ca967bf1ca2b55a6543c180aceaeb.tar.xz openssh-18a32a7efa9ca967bf1ca2b55a6543c180aceaeb.zip |
- itojun@cvs.openbsd.org 2002/06/09 22:17:21
[sshconnect.c]
pass salen to sockaddr_ntop so that we are happy on linux/solaris
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sshconnect.c | 10 |
2 files changed, 9 insertions, 6 deletions
@@ -4,6 +4,9 @@ - stevesk@cvs.openbsd.org 2002/06/09 22:15:15 [ssh.1] update for no setuid root and ssh-keysign; ok deraadt@ + - itojun@cvs.openbsd.org 2002/06/09 22:17:21 + [sshconnect.c] + pass salen to sockaddr_ntop so that we are happy on linux/solaris 20020609 - (bal) OpenBSD CVS Sync @@ -869,4 +872,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2200 2002/06/11 15:45:02 mouring Exp $ +$Id: ChangeLog,v 1.2201 2002/06/11 15:46:34 mouring Exp $ diff --git a/sshconnect.c b/sshconnect.c index 369b31dfe..651e3fcf4 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.122 2002/06/09 04:33:27 markus Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.123 2002/06/09 22:17:21 itojun Exp $"); #include <openssl/bn.h> @@ -44,11 +44,11 @@ extern char *__progname; #endif static const char * -sockaddr_ntop(struct sockaddr *sa) +sockaddr_ntop(struct sockaddr *sa, socklen_t salen) { static char addrbuf[NI_MAXHOST]; - if (getnameinfo(sa, sa->sa_len, addrbuf, sizeof(addrbuf), NULL, 0, + if (getnameinfo(sa, salen, addrbuf, sizeof(addrbuf), NULL, 0, NI_NUMERICHOST) != 0) fatal("sockaddr_ntop: getnameinfo NI_NUMERICHOST failed"); return addrbuf; @@ -322,8 +322,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, if (errno == ECONNREFUSED) full_failure = 0; log("ssh: connect to address %s port %s: %s", - sockaddr_ntop(ai->ai_addr), strport, - strerror(errno)); + sockaddr_ntop(ai->ai_addr, ai->ai_addrlen), + strport, strerror(errno)); restore_uid(); /* * Close the failed socket; there appear to |