diff options
Diffstat (limited to 'canohost.c')
-rw-r--r-- | canohost.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/canohost.c b/canohost.c index 2345cc35c..42011fd0a 100644 --- a/canohost.c +++ b/canohost.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: canohost.c,v 1.61 2006/08/03 03:34:41 deraadt Exp $ */ | 1 | /* $OpenBSD: canohost.c,v 1.63 2008/06/12 00:03:49 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -32,6 +32,7 @@ | |||
32 | #include "packet.h" | 32 | #include "packet.h" |
33 | #include "log.h" | 33 | #include "log.h" |
34 | #include "canohost.h" | 34 | #include "canohost.h" |
35 | #include "misc.h" | ||
35 | 36 | ||
36 | static void check_ip_options(int, char *); | 37 | static void check_ip_options(int, char *); |
37 | 38 | ||
@@ -88,7 +89,7 @@ get_remote_hostname(int sock, int use_dns) | |||
88 | memset(&hints, 0, sizeof(hints)); | 89 | memset(&hints, 0, sizeof(hints)); |
89 | hints.ai_socktype = SOCK_DGRAM; /*dummy*/ | 90 | hints.ai_socktype = SOCK_DGRAM; /*dummy*/ |
90 | hints.ai_flags = AI_NUMERICHOST; | 91 | hints.ai_flags = AI_NUMERICHOST; |
91 | if (getaddrinfo(name, "0", &hints, &ai) == 0) { | 92 | if (getaddrinfo(name, NULL, &hints, &ai) == 0) { |
92 | logit("Nasty PTR record \"%s\" is set up for %s, ignoring", | 93 | logit("Nasty PTR record \"%s\" is set up for %s, ignoring", |
93 | name, ntop); | 94 | name, ntop); |
94 | freeaddrinfo(ai); | 95 | freeaddrinfo(ai); |
@@ -271,7 +272,7 @@ get_socket_address(int sock, int remote, int flags) | |||
271 | if ((r = getnameinfo((struct sockaddr *)&addr, addrlen, ntop, | 272 | if ((r = getnameinfo((struct sockaddr *)&addr, addrlen, ntop, |
272 | sizeof(ntop), NULL, 0, flags)) != 0) { | 273 | sizeof(ntop), NULL, 0, flags)) != 0) { |
273 | error("get_socket_address: getnameinfo %d failed: %s", flags, | 274 | error("get_socket_address: getnameinfo %d failed: %s", flags, |
274 | r == EAI_SYSTEM ? strerror(errno) : gai_strerror(r)); | 275 | ssh_gai_strerror(r)); |
275 | return NULL; | 276 | return NULL; |
276 | } | 277 | } |
277 | return xstrdup(ntop); | 278 | return xstrdup(ntop); |
@@ -372,7 +373,7 @@ get_sock_port(int sock, int local) | |||
372 | if ((r = getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, | 373 | if ((r = getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, |
373 | strport, sizeof(strport), NI_NUMERICSERV)) != 0) | 374 | strport, sizeof(strport), NI_NUMERICSERV)) != 0) |
374 | fatal("get_sock_port: getnameinfo NI_NUMERICSERV failed: %s", | 375 | fatal("get_sock_port: getnameinfo NI_NUMERICSERV failed: %s", |
375 | r == EAI_SYSTEM ? strerror(errno) : gai_strerror(r)); | 376 | ssh_gai_strerror(r)); |
376 | return atoi(strport); | 377 | return atoi(strport); |
377 | } | 378 | } |
378 | 379 | ||