mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
options: Fix setting the port.
Make sure we correctly read the port from the config file. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -891,11 +891,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user