summaryrefslogtreecommitdiff
path: root/canohost.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-06-22 12:56:01 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-06-22 12:56:01 +1000
commit3f9fdc71219d498a996c4e4ca8330df7f598fb5d (patch)
tree902072deed2ca26a5b0b3fa5f3749783e0bd62e6 /canohost.c
parentb357afc0a03a4238a01acf5d9641ebda9f71d500 (diff)
- avsm@cvs.openbsd.org 2004/06/21 17:36:31
[auth-rsa.c auth2-gss.c auth2-pubkey.c authfile.c canohost.c channels.c cipher.c dns.c kex.c monitor.c monitor_fdpass.c monitor_wrap.c monitor_wrap.h nchan.c packet.c progressmeter.c scp.c sftp-server.c sftp.c ssh-gss.h ssh-keygen.c ssh.c sshconnect.c sshconnect1.c sshlogin.c sshpty.c] make ssh -Wshadow clean, no functional changes markus@ ok There are also some portable-specific -Wshadow warnings to be fixed in monitor.c and montior_wrap.c.
Diffstat (limited to 'canohost.c')
-rw-r--r--canohost.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/canohost.c b/canohost.c
index 54369d49..057f061b 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: canohost.c,v 1.39 2004/03/31 21:58:47 djm Exp $");
+RCSID("$OpenBSD: canohost.c,v 1.40 2004/06/21 17:36:31 avsm Exp $");
#include "packet.h"
#include "xmalloc.h"
@@ -28,7 +28,7 @@ static void ipv64_normalise_mapped(struct sockaddr_storage *, socklen_t *);
*/
static char *
-get_remote_hostname(int socket, int use_dns)
+get_remote_hostname(int sock, int use_dns)
{
struct sockaddr_storage from;
int i;
@@ -39,13 +39,13 @@ get_remote_hostname(int socket, int use_dns)
/* Get IP address of client. */
fromlen = sizeof(from);
memset(&from, 0, sizeof(from));
- if (getpeername(socket, (struct sockaddr *)&from, &fromlen) < 0) {
+ if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) {
debug("getpeername failed: %.100s", strerror(errno));
cleanup_exit(255);
}
if (from.ss_family == AF_INET)
- check_ip_options(socket, ntop);
+ check_ip_options(sock, ntop);
ipv64_normalise_mapped(&from, &fromlen);
@@ -138,7 +138,7 @@ get_remote_hostname(int socket, int use_dns)
*/
/* IPv4 only */
static void
-check_ip_options(int socket, char *ipaddr)
+check_ip_options(int sock, char *ipaddr)
{
#ifdef IP_OPTIONS
u_char options[200];
@@ -152,7 +152,7 @@ check_ip_options(int socket, char *ipaddr)
else
ipproto = IPPROTO_IP;
option_size = sizeof(options);
- if (getsockopt(socket, ipproto, IP_OPTIONS, options,
+ if (getsockopt(sock, ipproto, IP_OPTIONS, options,
&option_size) >= 0 && option_size != 0) {
text[0] = '\0';
for (i = 0; i < option_size; i++)
@@ -227,7 +227,7 @@ get_canonical_hostname(int use_dns)
* The returned string must be freed.
*/
static char *
-get_socket_address(int socket, int remote, int flags)
+get_socket_address(int sock, int remote, int flags)
{
struct sockaddr_storage addr;
socklen_t addrlen;
@@ -238,11 +238,11 @@ get_socket_address(int socket, int remote, int flags)
memset(&addr, 0, sizeof(addr));
if (remote) {
- if (getpeername(socket, (struct sockaddr *)&addr, &addrlen)
+ if (getpeername(sock, (struct sockaddr *)&addr, &addrlen)
< 0)
return NULL;
} else {
- if (getsockname(socket, (struct sockaddr *)&addr, &addrlen)
+ if (getsockname(sock, (struct sockaddr *)&addr, &addrlen)
< 0)
return NULL;
}
@@ -261,29 +261,29 @@ get_socket_address(int socket, int remote, int flags)
}
char *
-get_peer_ipaddr(int socket)
+get_peer_ipaddr(int sock)
{
char *p;
- if ((p = get_socket_address(socket, 1, NI_NUMERICHOST)) != NULL)
+ if ((p = get_socket_address(sock, 1, NI_NUMERICHOST)) != NULL)
return p;
return xstrdup("UNKNOWN");
}
char *
-get_local_ipaddr(int socket)
+get_local_ipaddr(int sock)
{
char *p;
- if ((p = get_socket_address(socket, 0, NI_NUMERICHOST)) != NULL)
+ if ((p = get_socket_address(sock, 0, NI_NUMERICHOST)) != NULL)
return p;
return xstrdup("UNKNOWN");
}
char *
-get_local_name(int socket)
+get_local_name(int sock)
{
- return get_socket_address(socket, 0, NI_NAMEREQD);
+ return get_socket_address(sock, 0, NI_NAMEREQD);
}
/*