diff options
author | djm@openbsd.org <djm@openbsd.org> | 2016-03-07 19:02:43 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-03-08 06:20:35 +1100 |
commit | 95767262caa6692eff1e1565be1f5cb297949a89 (patch) | |
tree | 1055360a328d0998dabb966f2e1002389f8c6c41 /ssh.c | |
parent | af0bb38ffd1f2c4f9f43b0029be2efe922815255 (diff) |
upstream commit
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@
Upstream-ID: 5f2e4df88d4803fc8ec59ec53629105e23ce625e
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.436 2016/02/15 09:47:49 dtucker Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.437 2016/03/07 19:02:43 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 |
@@ -513,6 +513,7 @@ set_addrinfo_port(struct addrinfo *addrs, int port) | |||
513 | int | 513 | int |
514 | main(int ac, char **av) | 514 | main(int ac, char **av) |
515 | { | 515 | { |
516 | struct ssh *ssh = NULL; | ||
516 | int i, r, opt, exit_status, use_syslog, config_test = 0; | 517 | int i, r, opt, exit_status, use_syslog, config_test = 0; |
517 | char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; | 518 | char *p, *cp, *line, *argv0, buf[PATH_MAX], *host_arg, *logfile; |
518 | char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; | 519 | char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; |
@@ -1220,6 +1221,8 @@ main(int ac, char **av) | |||
1220 | packet_set_timeout(options.server_alive_interval, | 1221 | packet_set_timeout(options.server_alive_interval, |
1221 | options.server_alive_count_max); | 1222 | options.server_alive_count_max); |
1222 | 1223 | ||
1224 | ssh = active_state; /* XXX */ | ||
1225 | |||
1223 | if (timeout_ms > 0) | 1226 | if (timeout_ms > 0) |
1224 | debug3("timeout: %d ms remain after connect", timeout_ms); | 1227 | debug3("timeout: %d ms remain after connect", timeout_ms); |
1225 | 1228 | ||
@@ -1346,7 +1349,7 @@ main(int ac, char **av) | |||
1346 | 1349 | ||
1347 | if (packet_connection_is_on_socket()) { | 1350 | if (packet_connection_is_on_socket()) { |
1348 | verbose("Authenticated to %s ([%s]:%d).", host, | 1351 | verbose("Authenticated to %s ([%s]:%d).", host, |
1349 | get_remote_ipaddr(), get_remote_port()); | 1352 | ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); |
1350 | } else { | 1353 | } else { |
1351 | verbose("Authenticated to %s (via proxy).", host); | 1354 | verbose("Authenticated to %s (via proxy).", host); |
1352 | } | 1355 | } |