Module: sip-router Branch: ser_core_cvs Commit: 235631a00531fd84d8ddb3ba72ed815b22ea647e URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=235631a0...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Andrei Pelinescu-Onciul andrei@iptel.org Date: Fri Dec 12 23:25:39 2008 +0000
sctp: SO_REUSEADDR on the sctp sockets
Reported-by: Michal Matyska, michal.matyska at iptel org
---
sctp_server.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/sctp_server.c b/sctp_server.c index 4a30954..7ac8444 100644 --- a/sctp_server.c +++ b/sctp_server.c @@ -216,6 +216,15 @@ static int sctp_init_sock_opt_common(int s) } } + /* set reuseaddr */ + if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (void*)&optval, sizeof(optval))==-1){ + LOG(L_ERR, "ERROR: sctp_init_sock_opt_common: setsockopt:" + " SO_REUSEADDR (%d): %s\n", optval, strerror(errno)); + /* continue, non-critical */ + } + + /* disable fragments interleave (SCTP_FRAGMENT_INTERLEAVE) -- * we don't want partial delivery, so fragment interleave must be off too */