diff options
author | 2016-03-07 19:02:43 +0000 | |
---|---|---|
committer | 2016-03-07 19:02:43 +0000 | |
commit | 1667b834089972f87df60db7feef35bbf760a6fd (patch) | |
tree | a4e6c871eda706efb994781026d7ebc3964eabab /usr.bin/ssh/ssh.c | |
parent | Make cp -i behave as mv -i or rm -i, independently of whether stdin (diff) | |
download | wireguard-openbsd-1667b834089972f87df60db7feef35bbf760a6fd.tar.xz wireguard-openbsd-1667b834089972f87df60db7feef35bbf760a6fd.zip |
refactor canohost.c: move functions that cache results closer to the
places that use them (authn and session code). After this, no state is
cached in canohost.c
feedback and ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index f7d6fa00717..ec8a5150f9d 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.436 2016/02/15 09:47:49 dtucker Exp $ */ +/* $OpenBSD: ssh.c,v 1.437 2016/03/07 19:02:43 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -498,6 +498,7 @@ set_addrinfo_port(struct addrinfo *addrs, int port) int main(int ac, char **av) { + struct ssh *ssh = NULL; int i, r, opt, exit_status, use_syslog, config_test = 0; char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; @@ -1187,6 +1188,8 @@ main(int ac, char **av) packet_set_timeout(options.server_alive_interval, options.server_alive_count_max); + ssh = active_state; /* XXX */ + if (timeout_ms > 0) debug3("timeout: %d ms remain after connect", timeout_ms); @@ -1297,7 +1300,7 @@ main(int ac, char **av) if (packet_connection_is_on_socket()) { verbose("Authenticated to %s ([%s]:%d).", host, - get_remote_ipaddr(), get_remote_port()); + ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); } else { verbose("Authenticated to %s (via proxy).", host); } |