summaryrefslogtreecommitdiff
path: root/canohost.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-11 16:47:22 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-11 16:47:22 +0000
commit9a17c9a568904d08b3d1e01ff5fc78ebd060101c (patch)
treea635212244742b48db1a455b86c6a9b3618400d0 /canohost.c
parentce0f6342702a660f97b57cbdeb671feb02bae382 (diff)
- itojun@cvs.openbsd.org 2002/06/11 08:11:45
[canohost.c] use "ntop" only after initialized
Diffstat (limited to 'canohost.c')
-rw-r--r--canohost.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/canohost.c b/canohost.c
index 03005aa29..00c499ca0 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: canohost.c,v 1.31 2002/02/27 21:23:13 stevesk Exp $"); 15RCSID("$OpenBSD: canohost.c,v 1.32 2002/06/11 08:11:45 itojun Exp $");
16 16
17#include "packet.h" 17#include "packet.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -64,13 +64,14 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
64 } 64 }
65 } 65 }
66#endif 66#endif
67 if (from.ss_family == AF_INET)
68 check_ip_options(socket, ntop);
69 67
70 if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), 68 if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop),
71 NULL, 0, NI_NUMERICHOST) != 0) 69 NULL, 0, NI_NUMERICHOST) != 0)
72 fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); 70 fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed");
73 71
72 if (from.ss_family == AF_INET)
73 check_ip_options(socket, ntop);
74
74 debug3("Trying to reverse map address %.100s.", ntop); 75 debug3("Trying to reverse map address %.100s.", ntop);
75 /* Map the IP address to a host name. */ 76 /* Map the IP address to a host name. */
76 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), 77 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),