Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131756767
D8243.id21363.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8243.id21363.diff
View Options
Index: sys/netinet/tcp_input.c
===================================================================
--- sys/netinet/tcp_input.c
+++ sys/netinet/tcp_input.c
@@ -1565,8 +1565,6 @@
* validation to ignore broken/spoofed segs.
*/
tp->t_rcvtime = ticks;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
/*
* Scale up the window into a 32-bit value.
Index: sys/netinet/tcp_stacks/fastpath.c
===================================================================
--- sys/netinet/tcp_stacks/fastpath.c
+++ sys/netinet/tcp_stacks/fastpath.c
@@ -1819,8 +1819,6 @@
* validation to ignore broken/spoofed segs.
*/
tp->t_rcvtime = ticks;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
/*
* Unscale the window into a 32-bit value.
@@ -2266,8 +2264,6 @@
* validation to ignore broken/spoofed segs.
*/
tp->t_rcvtime = ticks;
- if (TCPS_HAVEESTABLISHED(tp->t_state))
- tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
/*
* Unscale the window into a 32-bit value.
Index: sys/netinet/tcp_timer.c
===================================================================
--- sys/netinet/tcp_timer.c
+++ sys/netinet/tcp_timer.c
@@ -468,6 +468,26 @@
}
KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0,
("%s: tp %p tcpcb can't be stopped here", __func__, tp));
+
+ /*
+ * Because we don't regularly reset the keepalive callout in
+ * the ESTABLISHED state, it may be that we don't actually need
+ * to send a keepalive yet. If that occurs, schedule another
+ * call for the next time the keepalive timer might expire.
+ */
+ if (TCPS_HAVEESTABLISHED(tp->t_state)) {
+ u_int idletime;
+
+ idletime = ticks - tp->t_rcvtime;
+ if (idletime < TP_KEEPIDLE(tp)) {
+ callout_reset(&tp->t_timers->tt_keep,
+ TP_KEEPIDLE(tp) - idletime, tcp_timer_keep, tp);
+ INP_WUNLOCK(inp);
+ CURVNET_RESTORE();
+ return;
+ }
+ }
+
/*
* Keep-alive timer went off; send something
* or drop connection if idle for too long.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 11, 10:26 PM (18 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23595175
Default Alt Text
D8243.id21363.diff (1 KB)
Attached To
Mode
D8243: Reduce the number of calls to reset the keepalive timer
Attached
Detach File
Event Timeline
Log In to Comment