summaryrefslogtreecommitdiffstats
path: root/src/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2014-10-28 10:33:20 +0100
committerAndreas Schneider <asn@cryptomilk.org>2014-12-25 12:35:21 +0100
commita45dd8e00037125d0789fe6d4a8ab1557a02e5ac (patch)
tree8ad02cced31368d61e0d1bffe3c3d74418f75f88 /src/options.c
parent319129399d3191e9ddd04bef05d2c707ecaa9455 (diff)
options: Fix setting the port.
Make sure we correctly read the port from the config file. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit bb18442fe8f58a483713eb2b988b3da9869ddf86)
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/options.c b/src/options.c
index 3b702ef5..8d170206 100644
--- a/src/options.c
+++ b/src/options.c
@@ -871,11 +871,14 @@ int ssh_options_get_port(ssh_session session, unsigned int* port_target) {
if (session == NULL) {
return -1;
}
- if (!session->opts.port) {
- ssh_set_error_invalid(session);
- return -1;
+
+ if (session->opts.port == 0) {
+ *port_target = 22;
+ return 0;
}
+
*port_target = session->opts.port;
+
return 0;
}