]> andersk Git - openssh.git/blobdiff - canohost.c
- stevesk@cvs.openbsd.org 2001/04/05 15:48:18
[openssh.git] / canohost.c
index 52921f5b01526f918ce86a04883d1cd32f76ed34..927508f585d68a33a2673a178dbed74b5d2b39cb 100644 (file)
@@ -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
This page took 0.034241 seconds and 4 git commands to generate.