[OpenSIPS-Devel] Solution to longstanding SCTP problem
Michael Schloh
develop2009 at schloh.com
Sun Jan 27 20:06:05 CET 2013
Hello developers,
There's been reports [1][2] that SCTP doesn't work on all platforms.
According to some random (but up to date) Solaris [3] and Linux [4]
documentation, it seems that the protocol identifier 'IPPROTO_SCTP'
should be used when creating SCTP sockets.
Before I made this change to sctp_server.c line 72 (in SVN trunk)
starting OpenSIPS with the 'fork' option configured failed and wrote
the following error to the log:
ERROR:core:sctp_server_init: socket: Protocol not supported [120]
--- sctp_server.c.orig 2013-01-27 19:35:29.459074161 +0100
+++ sctp_server.c 2013-01-27 19:48:43.304765833 +0100
@@ -69,7 +69,7 @@
goto error;
}
- sock_info->socket = socket(AF2PF(addr->s.sa_family), SOCK_SEQPACKET, 0);
+ sock_info->socket = socket(AF2PF(addr->s.sa_family), SOCK_SEQPACKET, IPPROTO_SCTP);
if (sock_info->socket==-1){
LM_ERR("socket: %s [%d]\n", strerror(errno), errno);
goto error;
By the way, I've withhold comments about the Kamailio posts to keep
this short. My guess is that the poster in [2] didn't check his
solution.
[1] http://lists.kamailio.org/pipermail/devel/2008-January/011600.html
[2] http://lists.kamailio.org/pipermail/devel/2008-August/015551.html
[3] http://docs.oracle.com/cd/E26502_01/html/E35299/sockets-17.html
[4] http://linux.die.net/man/7/sctp
Regards,
Michael
More information about the Devel
mailing list