1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

bind: Fix ssh_bind_listen in normal case.

This commit is contained in:
Andreas Schneider
2011-10-17 19:27:29 +02:00
parent 1fcddebadc
commit d8d9755b7d

View File

@@ -204,11 +204,12 @@ int ssh_bind_listen(ssh_bind sshbind) {
} }
} }
if (sshbind->bindfd == SSH_INVALID_SOCKET) {
host = sshbind->bindaddr; host = sshbind->bindaddr;
if (host == NULL) { if (host == NULL) {
host = "0.0.0.0"; host = "0.0.0.0";
} }
if (sshbind->bindfd != SSH_INVALID_SOCKET){
fd = bind_socket(sshbind, host, sshbind->bindport); fd = bind_socket(sshbind, host, sshbind->bindport);
if (fd == SSH_INVALID_SOCKET) { if (fd == SSH_INVALID_SOCKET) {
ssh_key_free(sshbind->dsa); ssh_key_free(sshbind->dsa);