mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 11:55:36 +08:00
Update to FreeBSD head 2016-12-10
Git mirror commit 80c55f08a05ab3b26a73b226ccb56adc3122a55c.
This commit is contained in:
@@ -470,6 +470,26 @@ tcp_timer_keep(void *xtp)
|
||||
}
|
||||
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.
|
||||
|
Reference in New Issue
Block a user