TCP: avoid to send keepalive probes if receiving data
authorFlavio Leitner <fleitner@redhat.com>
Mon, 26 Apr 2010 18:33:27 +0000 (18:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Apr 2010 19:53:25 +0000 (12:53 -0700)
RFC 1122 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 acknowledgement packet is reseting the keepalive
timer but the data packet isn't. This patch fixes it by
checking the timestamp of the last received data packet
too when the keepalive timer expires.

Signed-off-by: Flavio Leitner <fleitner@redhat.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>

No differences found