[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] ssh_bind_listen() does not fail in windows when port is in use


Hi,
So, I found this code in bind_socket() function:

if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
                   (char *)&opt, sizeof(opt)) < 0) {
        ssh_set_error(sshbind,
                      SSH_FATAL,
                      "Setting socket options failed: %s",
                      strerror(errno));
        freeaddrinfo (ai);
        CLOSE_SOCKET(s);
        return -1;
    }

The socket has the SO_REUSEADDR so it does not fail when it is in use. I
don't know why that's set. Does anyone knows what is the intention of it?

Cheers



On Thu, Mar 21, 2019 at 1:59 PM Alberto Garcia <agarciaillera@xxxxxxxxx>
wrote:

> Hi,
>
> I see that ssh_bind_listen() does not fail in windows when the
> selected SSH_BIND_OPTIONS_BINDPORT is already taken by other listening
> process.
>
> Cheers.
> --
> Alberto García Illera
>
> GPG Public Key <https://goo.gl/yshdwh>
>


-- 
Alberto García Illera

GPG Public Key <https://goo.gl/yshdwh>

References:
[BUG] ssh_bind_listen() does not fail in windows when port is in useAlberto Garcia <agarciaillera@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org