aboutsummaryrefslogtreecommitdiff
path: root/src/bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bind.c')
-rw-r--r--src/bind.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bind.c b/src/bind.c
index 3077df84..e86f8210 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);