diff options
Diffstat (limited to 'canohost.c')
-rw-r--r-- | canohost.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/canohost.c b/canohost.c index 015a328e8..4f2e576b2 100644 --- a/canohost.c +++ b/canohost.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: canohost.c,v 1.28 2001/12/05 03:56:39 itojun Exp $"); | 15 | RCSID("$OpenBSD: canohost.c,v 1.29 2001/12/19 07:18:56 deraadt Exp $"); |
16 | 16 | ||
17 | #include "packet.h" | 17 | #include "packet.h" |
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
@@ -68,13 +68,13 @@ get_remote_hostname(int socket, int reverse_mapping_check) | |||
68 | check_ip_options(socket, ntop); | 68 | check_ip_options(socket, ntop); |
69 | 69 | ||
70 | if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), | 70 | if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), |
71 | NULL, 0, NI_NUMERICHOST) != 0) | 71 | NULL, 0, NI_NUMERICHOST) != 0) |
72 | fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); | 72 | fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); |
73 | 73 | ||
74 | debug3("Trying to reverse map address %.100s.", ntop); | 74 | debug3("Trying to reverse map address %.100s.", ntop); |
75 | /* Map the IP address to a host name. */ | 75 | /* Map the IP address to a host name. */ |
76 | if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), | 76 | if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), |
77 | NULL, 0, NI_NAMEREQD) != 0) { | 77 | NULL, 0, NI_NAMEREQD) != 0) { |
78 | /* Host name not found. Use ip address. */ | 78 | /* Host name not found. Use ip address. */ |
79 | log("Could not reverse map address %.100s.", ntop); | 79 | log("Could not reverse map address %.100s.", ntop); |
80 | return xstrdup(ntop); | 80 | return xstrdup(ntop); |
@@ -230,7 +230,7 @@ get_socket_address(int socket, int remote, int flags) | |||
230 | } | 230 | } |
231 | /* Get the address in ascii. */ | 231 | /* Get the address in ascii. */ |
232 | if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), | 232 | if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), |
233 | NULL, 0, flags) != 0) { | 233 | NULL, 0, flags) != 0) { |
234 | error("get_socket_ipaddr: getnameinfo %d failed", flags); | 234 | error("get_socket_ipaddr: getnameinfo %d failed", flags); |
235 | return NULL; | 235 | return NULL; |
236 | } | 236 | } |
@@ -316,7 +316,7 @@ get_sock_port(int sock, int local) | |||
316 | } | 316 | } |
317 | /* Return port number. */ | 317 | /* Return port number. */ |
318 | if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, | 318 | if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, |
319 | strport, sizeof(strport), NI_NUMERICSERV) != 0) | 319 | strport, sizeof(strport), NI_NUMERICSERV) != 0) |
320 | fatal("get_sock_port: getnameinfo NI_NUMERICSERV failed"); | 320 | fatal("get_sock_port: getnameinfo NI_NUMERICSERV failed"); |
321 | return atoi(strport); | 321 | return atoi(strport); |
322 | } | 322 | } |