Date: Sun, 10 Aug 2014 23:09:55 +0300 From: David Bar <david.bar@gmail.com> To: freebsd-net@freebsd.org Subject: Question about tcp keep-alive timer Message-ID: <CAM4OgwywTtkFQaCiaj1TGxSOZRF9PHGiaKugr-MCUhC3VKNeSg@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi (Forgive me if this topic has been discussed before. I didn't find it in the archives) In tcp_input(), when a packet is received on an established socket the code re-arms the keep-alive timer, for each packet. Here: https://svnweb.freebsd.org/base/release/10.0.0/sys/netinet/tcp_input.c?revision=260789&view=markup#l1518 Isn't this a waste to do this for each packet? The setting of the timer when the connection becomes established should suffice if there was a small change in tcp_timer_keep(). If tcp_timer_keep() would first checks if tp->t_rcvtime is recent (newer than the TT_KEEPIDLE time), and would just re-arm the timer to go off later, then we would keep the same functionality. I can't think of any downsides to this idea. Any good reason why this hasn't been done before? Thanks, David Bar dbar at gmail dot com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM4OgwywTtkFQaCiaj1TGxSOZRF9PHGiaKugr-MCUhC3VKNeSg>