diff options
author | Stef Walter <stef@thewalter.net> | 2010-11-11 16:38:05 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2011-01-23 15:47:45 -0600 |
commit | 002738e77ae6149c43a3d55b9364d365e1483578 (patch) | |
tree | d3f61147a8fdee72890a0f6fb7019114012fe80a /common/spio.c | |
parent | 0238920875712b4e51f2d96f2146dc477b2de9d8 (diff) |
Don't force connections to come from same source port.
Also allow address reuse for connections in time wait state.
Diffstat (limited to 'common/spio.c')
-rw-r--r-- | common/spio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/spio.c b/common/spio.c index f8f2ef1..e9a22e0 100644 --- a/common/spio.c +++ b/common/spio.c @@ -180,7 +180,8 @@ int spio_connect(spctx_t* ctx, spio_t* io, const struct sockaddr_any* sdst, if (ssrc != NULL) { #ifdef HAVE_IP_TRANSPARENT int value = 1; - if(setsockopt(fd, SOL_IP, IP_TRANSPARENT, &value, sizeof(value)) < 0) { + if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value)) < 0 || + setsockopt(fd, SOL_IP, IP_TRANSPARENT, &value, sizeof(value)) < 0) { sp_message(ctx, LOG_DEBUG, "%s: couldn't set transparent mode on connection", GET_IO_NAME(io)); ssrc = NULL; |