summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-10-10 07:53:04 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-10-10 07:53:04 -0500
commit49e6356620fb8cdf9da13ad5ec8f441a9c5506a1 (patch)
treee82b44892a71a0c17504624f15210fb6862d4a2b
parent7d9fa0bea474edd9a98a329ac44508d8bcf75aa0 (diff)
parentfeeb0974eb330cb92c9d6c0f54a388267a6f3bbc (diff)
Merge "tcptls: Do not re-bind to wildcard on client creation."
-rw-r--r--main/tcptls.c3
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",