[SR-Users] Binding arbitrary TLS socket

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 2 21:34:52 CEST 2012


Hello,

On 6/28/12 4:41 PM, Andreas Granig wrote:
> On 06/28/2012 04:35 PM, Andreas Granig wrote:
>> Got some problems when I tried this, not sure how this is intended to work:
>>
>> listen=tls:192.168.51.133:4343
>>
>> When starting kamailio 3.3, I get the following error:
>>
>> ERROR: <core> [tcp_main.c:2915]: ERROR: tcp_init: bind(10,
>> 0x7f5eea45db24, 16) on 192.168.51.133:4343 : Address already in use
>> ERROR: tls [tls_init.c:314]: Error while initializing TCP part of TLS
>> socket 192.168.51.133:4343
>>
>> What works though is if I explicitely bind a TCP socket one port below
>> the TLS socket, like this:
>>
>> listen=tcp:192.168.51.133:4342
>> listen=tls:192.168.51.133:4343
>>
>> Is this how it's intended to work? Is there a specific reason for this
>> behavior?
> Hmmmm, tried playing around with odd and even ports for tls, and now it
> also works with the original approach from above (binding to TLS without
> binding a TCP socket one port below that).
>
> Maybe there was something wrong with my system somewhere (an old socket
> still in use or something, although netstat didn't show up anything).
> Does kamailio reuse old sockets for TCP/TLS?

grepping for SO_REUSEADDR flag revealed it is in use, but haven't looked 
in the code to see if it depends on other conditions.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - http://asipto.com/u/kpw




More information about the sr-users mailing list