aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-10-17 19:27:29 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-10-17 19:27:29 +0200
commitd8d9755b7ddeb2aee944d086ef95589a37532fd1 (patch)
treec6fec55e48f936dfc57031b4bb203052c45005bb
parent1fcddebadc178670e49447d4e7f07804add15a46 (diff)
downloadlibssh-d8d9755b7ddeb2aee944d086ef95589a37532fd1.tar.gz
libssh-d8d9755b7ddeb2aee944d086ef95589a37532fd1.tar.xz
libssh-d8d9755b7ddeb2aee944d086ef95589a37532fd1.zip
bind: Fix ssh_bind_listen in normal case.
-rw-r--r--src/bind.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bind.c b/src/bind.c
index 3077df8..e86f821 100644
--- a/src/bind.c
+++ b/src/bind.c
@@ -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);