[Swan] Problem with SAupdate when SA does not exist in the kernel

Philippe Vouters philippe.vouters at laposte.net
Thu Sep 12 16:09:59 EEST 2013


Dear Thomas,

One reason I see why my C code samples do not contain any such :

     optval = 60;
     setsockopt(my_socket, SOL_TCP, TCP_KEEPIDLE, &optval, sizeof(optval));

     optval = 60;
     setsockopt(my_socket, SOL_TCP, TCP_KEEPINTVL, &optval, sizeof(optval));

     optval = 3;
     setsockopt(my_socket, SOL_TCP, TCP_KEEPCNT, &optval, sizeof(optval));


is that the second parameter (SOL_TCP) is highly operating system dependant.

If I refer to another operating system I also work on, namely OpenVMS, 
what would correspond to your SOL_TCP is IPPROTO_TCP as described at 
http://h71000.www7.hp.com/doc/73final/6529/6529pro_022.html

If I refer to this curl information at 
http://curl.haxx.se/mail/lib-2012-01/0264.html, it clearly says:
"
While not all operating systems support the TCP_KEEPIDLE and
TCP_KEEPINTVL knobs, the library will still allow these options to be
set by clients, silently ignoring the values.
"

In the hope this helps to complete the subject.

Philippe Vouters (Fontainebleau/France)
URL: http://vouters.dyndns.org/
SIP: sip:Vouters at sip.linphone.org

On 09/12/2013 02:45 PM, Thomas Geulig wrote:
> Am Donnerstag, 12. September 2013, 14:23:50 schrieb Philippe Vouters:
>> I checked my existing C codes and I could only code SO_KEEPALIVE as an
>> only on or off socket option. As far as it looks, there is no way for a
>> programmer to adjust the KEEPALIVE timer from within his code.
> It is possible to set the values like this:
>
> void activate_tcp_keepalive(int my_socket)
> {
>      int optval;
>
>      optval = 1;
>      setsockopt(my_socket, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval));
>
>      optval = 60;
>      setsockopt(my_socket, SOL_TCP, TCP_KEEPIDLE, &optval, sizeof(optval));
>
>      optval = 60;
>      setsockopt(my_socket, SOL_TCP, TCP_KEEPINTVL, &optval, sizeof(optval));
>
>      optval = 3;
>      setsockopt(my_socket, SOL_TCP, TCP_KEEPCNT, &optval, sizeof(optval));
> }
>
> TCP_KEEPIDLE  : tcp_keepalive_time
> TCP_KEEPINTVL : tcp_keepalive_intvl
> TCP_KEEPCNT   : tcp_keepalive_probes
>
> Best regards
>
> Thomas
>
>
>



More information about the Swan mailing list