Commit 1e2f53a6 authored by Andreas Schneider's avatar Andreas Schneider

swrap: Automatically bind an ephemeral port if needed

Signed-off-by: default avatarAndreas Schneider <asn@samba.org>
Reviewed-by: default avatarStefan Metzmacher <metze@samba.org>
parent f24f91eb
......@@ -3154,6 +3154,14 @@ static int swrap_listen(int s, int backlog)
return libc_listen(s, backlog);
}
if (si->bound == 0) {
ret = swrap_auto_bind(s, si, si->family);
if (ret == -1) {
errno = EADDRINUSE;
return ret;
}
}
ret = libc_listen(s, backlog);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment