summaryrefslogtreecommitdiff
path: root/canohost.c
diff options
context:
space:
mode:
authordjm <djm>2013-10-15 01:14:12 +0000
committerdjm <djm>2013-10-15 01:14:12 +0000
commitdf242871bc4ebe07439e1ba960a885871a221156 (patch)
tree0a89c2a0e8035b53a53e97e4de5282334ed8ddc9 /canohost.c
parent922d4e02e6133fe525ea8d27aeae0c4c05daee6c (diff)
downloadopenssh-df242871bc4ebe07439e1ba960a885871a221156.tar.gz
- djm@cvs.openbsd.org 2013/10/14 23:28:23
[canohost.c misc.c misc.h readconf.c sftp-server.c ssh.c] refactor client config code a little: add multistate option partsing to readconf.c, similar to servconf.c's existing code. move checking of options that accept "none" as an argument to readconf.c add a lowercase() function and use it instead of explicit tolower() in loops part of a larger diff that was ok markus@
Diffstat (limited to 'canohost.c')
-rw-r--r--canohost.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/canohost.c b/canohost.c
index 69e8e6f6..a8eeb0e3 100644
--- a/canohost.c
+++ b/canohost.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: canohost.c,v 1.67 2013/05/17 00:13:13 djm Exp $ */
+/* $OpenBSD: canohost.c,v 1.68 2013/10/14 23:28:22 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -48,7 +48,6 @@ static char *
get_remote_hostname(int sock, int use_dns)
{
struct sockaddr_storage from;
- int i;
socklen_t fromlen;
struct addrinfo hints, *ai, *aitop;
char name[NI_MAXHOST], ntop[NI_MAXHOST], ntop2[NI_MAXHOST];
@@ -99,13 +98,9 @@ get_remote_hostname(int sock, int use_dns)
return xstrdup(ntop);
}
- /*
- * Convert it to all lowercase (which is expected by the rest
- * of this software).
- */
- for (i = 0; name[i]; i++)
- if (isupper(name[i]))
- name[i] = (char)tolower(name[i]);
+ /* Names are stores in lowercase. */
+ lowercase(name);
+
/*
* Map it back to an IP address and check that the given
* address actually is an address of this host. This is