Update to FreeBSD head 2016-12-10

Git mirror commit 80c55f08a05ab3b26a73b226ccb56adc3122a55c.
This commit is contained in:
Sebastian Huber
2016-12-09 14:19:03 +01:00
parent c4e89a9125
commit 75b706fde4
227 changed files with 3800 additions and 3006 deletions

View File

@@ -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.