=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/canohost.c,v retrieving revision 1.26.2.2 retrieving revision 1.27 diff -u -r1.26.2.2 -r1.27 --- src/usr.bin/ssh/canohost.c 2002/03/09 00:20:44 1.26.2.2 +++ src/usr.bin/ssh/canohost.c 2001/06/23 15:12:17 1.27 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: canohost.c,v 1.26.2.2 2002/03/09 00:20:44 miod Exp $"); +RCSID("$OpenBSD: canohost.c,v 1.27 2001/06/23 15:12:17 itojun Exp $"); #include "packet.h" #include "xmalloc.h" @@ -27,7 +27,7 @@ */ static char * -get_remote_hostname(int socket, int verify_reverse_mapping) +get_remote_hostname(int socket, int reverse_mapping_check) { struct sockaddr_storage from; int i; @@ -46,13 +46,13 @@ check_ip_options(socket, ntop); if (getnameinfo((struct sockaddr *)&from, fromlen, ntop, sizeof(ntop), - NULL, 0, NI_NUMERICHOST) != 0) + NULL, 0, NI_NUMERICHOST) != 0) fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); debug3("Trying to reverse map address %.100s.", ntop); /* Map the IP address to a host name. */ if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), - NULL, 0, NI_NAMEREQD) != 0) { + NULL, 0, NI_NAMEREQD) != 0) { /* Host name not found. Use ip address. */ log("Could not reverse map address %.100s.", ntop); return xstrdup(ntop); @@ -68,7 +68,7 @@ if (isupper(name[i])) name[i] = tolower(name[i]); - if (!verify_reverse_mapping) + if (!reverse_mapping_check) return xstrdup(name); /* * Map it back to an IP address and check that the given @@ -132,7 +132,7 @@ else ipproto = IPPROTO_IP; option_size = sizeof(options); - if (getsockopt(socket, ipproto, IP_OPTIONS, options, + if (getsockopt(socket, ipproto, IP_OPTIONS, (void *)options, &option_size) >= 0 && option_size != 0) { text[0] = '\0'; for (i = 0; i < option_size; i++) @@ -152,14 +152,14 @@ */ const char * -get_canonical_hostname(int verify_reverse_mapping) +get_canonical_hostname(int reverse_mapping_check) { static char *canonical_host_name = NULL; - static int verify_reverse_mapping_done = 0; + static int reverse_mapping_checked = 0; /* Check if we have previously retrieved name with same option. */ if (canonical_host_name != NULL) { - if (verify_reverse_mapping_done != verify_reverse_mapping) + if (reverse_mapping_checked != reverse_mapping_check) xfree(canonical_host_name); else return canonical_host_name; @@ -168,11 +168,11 @@ /* Get the real hostname if socket; otherwise return UNKNOWN. */ if (packet_connection_is_on_socket()) canonical_host_name = get_remote_hostname( - packet_get_connection_in(), verify_reverse_mapping); + packet_get_connection_in(), reverse_mapping_check); else canonical_host_name = xstrdup("UNKNOWN"); - verify_reverse_mapping_done = verify_reverse_mapping; + reverse_mapping_checked = reverse_mapping_check; return canonical_host_name; } @@ -208,7 +208,7 @@ } /* Get the address in ascii. */ if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop), - NULL, 0, flags) != 0) { + NULL, 0, flags) != 0) { error("get_socket_ipaddr: getnameinfo %d failed", flags); return NULL; } @@ -239,7 +239,7 @@ */ const char * -get_remote_ipaddr(void) +get_remote_ipaddr() { static char *canonical_host_ip = NULL; @@ -259,11 +259,11 @@ } const char * -get_remote_name_or_ip(u_int utmp_len, int verify_reverse_mapping) +get_remote_name_or_ip(u_int utmp_len, int reverse_mapping_check) { static const char *remote = ""; if (utmp_len > 0) - remote = get_canonical_hostname(verify_reverse_mapping); + remote = get_canonical_hostname(reverse_mapping_check); if (utmp_len == 0 || strlen(remote) > utmp_len) remote = get_remote_ipaddr(); return remote; @@ -294,7 +294,7 @@ } /* Return port number. */ if (getnameinfo((struct sockaddr *)&from, fromlen, NULL, 0, - strport, sizeof(strport), NI_NUMERICSERV) != 0) + strport, sizeof(strport), NI_NUMERICSERV) != 0) fatal("get_sock_port: getnameinfo NI_NUMERICSERV failed"); return atoi(strport); } @@ -322,13 +322,13 @@ } int -get_remote_port(void) +get_remote_port() { return get_port(0); } int -get_local_port(void) +get_local_port() { return get_port(1); }