summaryrefslogtreecommitdiffstats
path: root/canohost.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-10-15 03:14:12 +0200
committerDamien Miller <djm@mindrot.org>2013-10-15 03:14:12 +0200
commite9fc72edd6c313b670558cd5219601c38a949b67 (patch)
tree32ed93978e93622d5829a55cbc0479e00b1161bf /canohost.c
parent - djm@cvs.openbsd.org 2013/10/14 22:22:05 (diff)
downloadopenssh-e9fc72edd6c313b670558cd5219601c38a949b67.tar.xz
openssh-e9fc72edd6c313b670558cd5219601c38a949b67.zip
- 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 69e8e6f6d..a8eeb0e35 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