diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-10-17 19:27:29 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-10-17 19:27:29 +0200 |
commit | d8d9755b7ddeb2aee944d086ef95589a37532fd1 (patch) | |
tree | c6fec55e48f936dfc57031b4bb203052c45005bb | |
parent | 1fcddebadc178670e49447d4e7f07804add15a46 (diff) | |
download | libssh-d8d9755b7ddeb2aee944d086ef95589a37532fd1.tar.gz libssh-d8d9755b7ddeb2aee944d086ef95589a37532fd1.tar.xz libssh-d8d9755b7ddeb2aee944d086ef95589a37532fd1.zip |
bind: Fix ssh_bind_listen in normal case.
-rw-r--r-- | src/bind.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -204,11 +204,12 @@ int ssh_bind_listen(ssh_bind sshbind) { } } - host = sshbind->bindaddr; - if (host == NULL) { - host = "0.0.0.0"; - } - if (sshbind->bindfd != SSH_INVALID_SOCKET){ + if (sshbind->bindfd == SSH_INVALID_SOCKET) { + host = sshbind->bindaddr; + if (host == NULL) { + host = "0.0.0.0"; + } + fd = bind_socket(sshbind, host, sshbind->bindport); if (fd == SSH_INVALID_SOCKET) { ssh_key_free(sshbind->dsa); |