diff options
Diffstat (limited to 'canohost.c')
-rw-r--r-- | canohost.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/canohost.c b/canohost.c index 69e8e6f6d..a19a60cda 100644 --- a/canohost.c +++ b/canohost.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: canohost.c,v 1.67 2013/05/17 00:13:13 djm Exp $ */ | 1 | /* $OpenBSD: canohost.c,v 1.70 2014/01/19 04:17:29 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 |
@@ -20,7 +20,6 @@ | |||
20 | #include <netinet/in.h> | 20 | #include <netinet/in.h> |
21 | #include <arpa/inet.h> | 21 | #include <arpa/inet.h> |
22 | 22 | ||
23 | #include <ctype.h> | ||
24 | #include <errno.h> | 23 | #include <errno.h> |
25 | #include <netdb.h> | 24 | #include <netdb.h> |
26 | #include <stdio.h> | 25 | #include <stdio.h> |
@@ -48,7 +47,6 @@ static char * | |||
48 | get_remote_hostname(int sock, int use_dns) | 47 | get_remote_hostname(int sock, int use_dns) |
49 | { | 48 | { |
50 | struct sockaddr_storage from; | 49 | struct sockaddr_storage from; |
51 | int i; | ||
52 | socklen_t fromlen; | 50 | socklen_t fromlen; |
53 | struct addrinfo hints, *ai, *aitop; | 51 | struct addrinfo hints, *ai, *aitop; |
54 | char name[NI_MAXHOST], ntop[NI_MAXHOST], ntop2[NI_MAXHOST]; | 52 | char name[NI_MAXHOST], ntop[NI_MAXHOST], ntop2[NI_MAXHOST]; |
@@ -99,13 +97,9 @@ get_remote_hostname(int sock, int use_dns) | |||
99 | return xstrdup(ntop); | 97 | return xstrdup(ntop); |
100 | } | 98 | } |
101 | 99 | ||
102 | /* | 100 | /* Names are stores in lowercase. */ |
103 | * Convert it to all lowercase (which is expected by the rest | 101 | lowercase(name); |
104 | * of this software). | 102 | |
105 | */ | ||
106 | for (i = 0; name[i]; i++) | ||
107 | if (isupper(name[i])) | ||
108 | name[i] = (char)tolower(name[i]); | ||
109 | /* | 103 | /* |
110 | * Map it back to an IP address and check that the given | 104 | * Map it back to an IP address and check that the given |
111 | * address actually is an address of this host. This is | 105 | * address actually is an address of this host. This is |
@@ -160,8 +154,7 @@ check_ip_options(int sock, char *ipaddr) | |||
160 | #ifdef IP_OPTIONS | 154 | #ifdef IP_OPTIONS |
161 | u_char options[200]; | 155 | u_char options[200]; |
162 | char text[sizeof(options) * 3 + 1]; | 156 | char text[sizeof(options) * 3 + 1]; |
163 | socklen_t option_size; | 157 | socklen_t option_size, i; |
164 | u_int i; | ||
165 | int ipproto; | 158 | int ipproto; |
166 | struct protoent *ip; | 159 | struct protoent *ip; |
167 | 160 | ||