Here is sthen's first diff again that fixes keepalives, without that stray variable and with the space vs. tabs nits cleared up.
It works well here, anyone willing to ok this for sthen? -Bryan. Index: netinet/tcp_input.c =================================================================== RCS file: /cvs/src/sys/netinet/tcp_input.c,v retrieving revision 1.250 diff -u -p -u -r1.250 tcp_input.c --- netinet/tcp_input.c 13 May 2011 14:31:16 -0000 1.250 +++ netinet/tcp_input.c 21 Jun 2011 11:51:40 -0000 @@ -961,8 +961,12 @@ findpcb: * Reset idle time and keep-alive timer. */ tp->t_rcvtime = tcp_now; - if (TCPS_HAVEESTABLISHED(tp->t_state)) - TCP_TIMER_ARM(tp, TCPT_KEEP, tcp_keepidle); + if (TCPS_HAVEESTABLISHED(tp->t_state)) { + if (tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) + TCP_TIMER_ARM(tp, TCPT_KEEP, tcp_keepintvl); + else + TCP_TIMER_ARM(tp, TCPT_KEEP, tcp_keepidle); + } #ifdef TCP_SACK if (tp->sack_enable)