From d8d9755b7ddeb2aee944d086ef95589a37532fd1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Oct 2011 19:27:29 +0200 Subject: bind: Fix ssh_bind_listen in normal case. --- src/bind.c | 11 ++++++----- 1 file 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); -- cgit