diff options
Diffstat (limited to 'canohost.c')
-rw-r--r-- | canohost.c | 13 |
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 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: canohost.c,v 1.23 2001/02/10 01:33:32 markus Exp $"); | 15 | RCSID("$OpenBSD: canohost.c,v 1.24 2001/04/05 15:48:19 stevesk Exp $"); |
16 | 16 | ||
17 | #include "packet.h" | 17 | #include "packet.h" |
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
@@ -251,6 +251,17 @@ get_remote_ipaddr() | |||
251 | return canonical_host_ip; | 251 | return canonical_host_ip; |
252 | } | 252 | } |
253 | 253 | ||
254 | const char * | ||
255 | get_remote_name_or_ip(u_int utmp_len, int reverse_mapping_check) | ||
256 | { | ||
257 | static const char *remote = ""; | ||
258 | if (utmp_len > 0) | ||
259 | remote = get_canonical_hostname(reverse_mapping_check); | ||
260 | if (utmp_len == 0 || strlen(remote) > utmp_len) | ||
261 | remote = get_remote_ipaddr(); | ||
262 | return remote; | ||
263 | } | ||
264 | |||
254 | /* Returns the local/remote port for the socket. */ | 265 | /* Returns the local/remote port for the socket. */ |
255 | 266 | ||
256 | int | 267 | int |