summaryrefslogtreecommitdiff
path: root/canohost.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-10-15 12:14:12 +1100
committerDamien Miller <djm@mindrot.org>2013-10-15 12:14:12 +1100
commite9fc72edd6c313b670558cd5219601c38a949b67 (patch)
tree32ed93978e93622d5829a55cbc0479e00b1161bf /canohost.c
parent194fd904d8597a274b93e075b2047afdf5a175d4 (diff)
- 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 @@
1/* $OpenBSD: canohost.c,v 1.67 2013/05/17 00:13:13 djm Exp $ */ 1/* $OpenBSD: canohost.c,v 1.68 2013/10/14 23:28:22 djm 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
@@ -48,7 +48,6 @@ static char *
48get_remote_hostname(int sock, int use_dns) 48get_remote_hostname(int sock, int use_dns)
49{ 49{
50 struct sockaddr_storage from; 50 struct sockaddr_storage from;
51 int i;
52 socklen_t fromlen; 51 socklen_t fromlen;
53 struct addrinfo hints, *ai, *aitop; 52 struct addrinfo hints, *ai, *aitop;
54 char name[NI_MAXHOST], ntop[NI_MAXHOST], ntop2[NI_MAXHOST]; 53 char name[NI_MAXHOST], ntop[NI_MAXHOST], ntop2[NI_MAXHOST];
@@ -99,13 +98,9 @@ get_remote_hostname(int sock, int use_dns)
99 return xstrdup(ntop); 98 return xstrdup(ntop);
100 } 99 }
101 100
102 /* 101 /* Names are stores in lowercase. */
103 * Convert it to all lowercase (which is expected by the rest 102 lowercase(name);
104 * of this software). 103
105 */
106 for (i = 0; name[i]; i++)
107 if (isupper(name[i]))
108 name[i] = (char)tolower(name[i]);
109 /* 104 /*
110 * Map it back to an IP address and check that the given 105 * Map it back to an IP address and check that the given
111 * address actually is an address of this host. This is 106 * address actually is an address of this host. This is