Subject: TCP keepalive question

From: Flavio Leitner <[email-masked]>
Date: Fri, 16 Apr 2010 12:06:44 -0300

Hi,

I'm reading the RFC 1122 and it says the following:
...
           Keep-alive packets MUST only be sent when no data or
           acknowledgement packets have been received for the
           connection within an interval.  
...

The receiving acknowledgement part seems to be ok and handled 
by tcp_keepalive_timer() when it does 
elapsed = tcp_time_stamp - tp->rcv_tstamp;

However, if one side just receive data and reply with ACK, the
keepalive probes is sent anyway - 2.6.32.9-70.fc12.i686.PAE.

Any reason to not reset keepalive timer when data is received?

Socket options used:
SO_KEEPALIVE, TCP_KEEPIDLE=40, TCP_KEEPCNT=6, TCP_KEEPINTVL=5

Traffic dump attached.

thanks!
-- 
Flavio