summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-02-09 09:53:48 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-02-09 09:53:48 +1100
commit96d4710e3838af8c03a55ce37913568877dd0283 (patch)
treecfa394a8c8023fb6f521411b95d35c175daa90d3 /sshd.c
parent5b53026f719bc0b2fc13a58ea0b6a0385e373bec (diff)
- dtucker@cvs.openbsd.org 2005/02/08 22:24:57
[sshd.c] Provide reason in error message if getnameinfo fails; ok markus@
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sshd.c b/sshd.c
index 6b379521..a5b7f1ca 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.307 2005/01/21 08:32:02 otto Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.308 2005/02/08 22:24:57 dtucker Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -1268,10 +1268,12 @@ main(int ac, char **av)
if (num_listen_socks >= MAX_LISTEN_SOCKS)
fatal("Too many listen sockets. "
"Enlarge MAX_LISTEN_SOCKS");
- if (getnameinfo(ai->ai_addr, ai->ai_addrlen,
+ if ((ret = getnameinfo(ai->ai_addr, ai->ai_addrlen,
ntop, sizeof(ntop), strport, sizeof(strport),
- NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
- error("getnameinfo failed");
+ NI_NUMERICHOST|NI_NUMERICSERV)) != 0) {
+ error("getnameinfo failed: %.100s",
+ (ret != EAI_SYSTEM) ? gai_strerror(ret) :
+ strerror(errno));
continue;
}
/* Create socket for listening. */