diff options
author | Alexander Traud <pabstraud@compuserve.com> | 2017-10-08 16:11:10 +0200 |
---|---|---|
committer | Alexander Traud <pabstraud@compuserve.com> | 2017-10-08 16:11:10 +0200 |
commit | feeb0974eb330cb92c9d6c0f54a388267a6f3bbc (patch) | |
tree | d6639f9fa4aaa98917fbe4da9ff0a4fa66d2ed43 /main/tcptls.c | |
parent | 79deaa6a96f6b5d7e061b95ef15b7e20790dc615 (diff) |
tcptls: Do not re-bind to wildcard on client creation.
Since ASTERISK-26922, this issue affected only those chan_sip which were
* enabled for dual-stack (bindaddr=::), and
* enabled for TCP (tcpenable=yes) and/or TLS (tlsenable=yes), and
* tried to register and/or invite a IPv4-only service,
* via TCP and/or TLS.
Now, ast_tcptls_client_create does not re-bind to [::] anymore.
ASTERISK-27324 #close
Change-Id: I4b242837bdeb1ec7130dc82505c6180a946fd9b5
Diffstat (limited to 'main/tcptls.c')
-rw-r--r-- | main/tcptls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/tcptls.c b/main/tcptls.c index ebe86f3e0..dbcff9da2 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -572,7 +572,8 @@ struct ast_tcptls_session_instance *ast_tcptls_client_create(struct ast_tcptls_s /* if a local address was specified, bind to it so the connection will originate from the desired address */ - if (!ast_sockaddr_isnull(&desc->local_address)) { + if (!ast_sockaddr_isnull(&desc->local_address) && + !ast_sockaddr_is_any(&desc->local_address)) { setsockopt(desc->accept_fd, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x)); if (ast_bind(desc->accept_fd, &desc->local_address)) { ast_log(LOG_ERROR, "Unable to bind %s to %s: %s\n", |