summaryrefslogtreecommitdiff
path: root/common/spio.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spio.c')
-rw-r--r--common/spio.c3
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;