diff --git a/include/libssh/socket.h b/include/libssh/socket.h index 5c296e0d..5e345c68 100644 --- a/include/libssh/socket.h +++ b/include/libssh/socket.h @@ -63,6 +63,9 @@ void ssh_socket_set_callbacks(ssh_socket s, ssh_socket_callbacks callbacks); int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd, int revents, void *v_s); struct ssh_poll_handle_struct * ssh_socket_get_poll_handle(ssh_socket s); -int ssh_socket_connect(ssh_socket s, const char *host, int port, const char *bind_addr); +int ssh_socket_connect(ssh_socket s, + const char *host, + uint16_t port, + const char *bind_addr); #endif /* SOCKET_H_ */ diff --git a/src/socket.c b/src/socket.c index bbba443d..db24f70b 100644 --- a/src/socket.c +++ b/src/socket.c @@ -806,9 +806,10 @@ int ssh_socket_set_blocking(socket_t fd) * @bug It only tries connecting to one of the available AI's * which is problematic for hosts having DNS fail-over. */ - -int -ssh_socket_connect(ssh_socket s, const char *host, int port, const char *bind_addr) +int ssh_socket_connect(ssh_socket s, + const char *host, + uint16_t port, + const char *bind_addr) { socket_t fd;