summaryrefslogtreecommitdiffstats
path: root/canohost.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-04-06 01:32:17 +0200
committerBen Lindstrom <mouring@eviladmin.org>2001-04-06 01:32:17 +0200
commitf15a386511f669b2bb81c57032f458ff3e9e93a6 (patch)
treee001d9c444890c2b13a56d829c5bc9b38934202b /canohost.c
parent - markus@cvs.openbsd.org 2001/04/05 15:45:43 (diff)
downloadopenssh-f15a386511f669b2bb81c57032f458ff3e9e93a6.tar.xz
openssh-f15a386511f669b2bb81c57032f458ff3e9e93a6.zip
- stevesk@cvs.openbsd.org 2001/04/05 15:48:18
[canohost.c canohost.h session.c] move get_remote_name_or_ip() to canohost.[ch]; for portable. ok markus@
Diffstat (limited to 'canohost.c')
-rw-r--r--canohost.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/canohost.c b/canohost.c
index 52921f5b0..927508f58 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: canohost.c,v 1.23 2001/02/10 01:33:32 markus Exp $");
+RCSID("$OpenBSD: canohost.c,v 1.24 2001/04/05 15:48:19 stevesk Exp $");
#include "packet.h"
#include "xmalloc.h"
@@ -251,6 +251,17 @@ get_remote_ipaddr()
return canonical_host_ip;
}
+const char *
+get_remote_name_or_ip(u_int utmp_len, int reverse_mapping_check)
+{
+ static const char *remote = "";
+ if (utmp_len > 0)
+ remote = get_canonical_hostname(reverse_mapping_check);
+ if (utmp_len == 0 || strlen(remote) > utmp_len)
+ remote = get_remote_ipaddr();
+ return remote;
+}
+
/* Returns the local/remote port for the socket. */
int