tp->t_rcvtime = ticks;
tp->t_flags &= ~TF_KEEPALIVE;
tcp_callout_reset(tp, tp->tt_keep,
- tcp_getkeepidle(tp),
+ tp->t_keepidle,
tcp_timer_keep);
}
}
tcp_established(struct tcpcb *tp)
{
tp->t_state = TCPS_ESTABLISHED;
- tcp_callout_reset(tp, tp->tt_keep, tcp_getkeepidle(tp), tcp_timer_keep);
+ tcp_callout_reset(tp, tp->tt_keep, tp->t_keepidle, tcp_timer_keep);
if (tp->t_rxtsyn > 0) {
/*
{
struct tcptemp *t_template;
#ifdef TCPDEBUG
- int ostate;
+ int ostate = tp->t_state;
#endif
- int keepidle = tcp_getkeepidle(tp);
-#ifdef TCPDEBUG
- ostate = tp->t_state;
-#endif
/*
* Keep-alive timer went off; send something
* or drop connection if idle for too long.
if ((always_keepalive || (tp->t_flags & TF_KEEPALIVE) ||
(tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE)) &&
tp->t_state <= TCPS_CLOSING) {
- if ((ticks - tp->t_rcvtime) >= keepidle + tp->t_maxidle)
+ if ((ticks - tp->t_rcvtime) >= tp->t_keepidle + tp->t_maxidle)
goto dropit;
/*
* Send a packet designed to force a response
tcp_callout_reset(tp, tp->tt_keep, tp->t_keepintvl,
tcp_timer_keep);
} else {
- tcp_callout_reset(tp, tp->tt_keep, keepidle,
+ tcp_callout_reset(tp, tp->tt_keep, tp->t_keepidle,
tcp_timer_keep);
}
#include <netinet/tcp_timer.h>
#endif
-/*
- * The TCP_FASTKEEP option uses keepintvl for the initial keepidle timeout
- * instead of keepidle.
- */
-static __inline int
-tcp_getkeepidle(struct tcpcb *_tp)
-{
- if (_tp->t_flags & TF_FASTKEEP)
- return (_tp->t_keepintvl);
- else
- return (_tp->t_keepidle);
-}
-
static __inline void
tcp_callout_stop(struct tcpcb *_tp, struct tcp_callout *_tc)
{
break;
switch (sopt->sopt_name) {
case TCP_FASTKEEP:
- if (optval > 0) {
- if ((tp->t_flags & TF_FASTKEEP) == 0) {
- tp->t_flags |= TF_FASTKEEP;
- tcp_timer_keep_activity(tp, 0);
- }
- } else {
- tp->t_flags &= ~TF_FASTKEEP;
- }
+ if (optval > 0)
+ tp->t_keepidle = tp->t_keepintvl;
+ else
+ tp->t_keepidle = tcp_keepidle;
+ tcp_timer_keep_activity(tp, 0);
break;
#ifdef TCP_SIGNATURE
case TCP_SIGNATURE_ENABLE:
#define TF_NOPUSH 0x00001000 /* don't push */
#define TF_LISTEN 0x00002000 /* listen(2) has been called */
#define TF_SIGNATURE 0x00004000 /* require MD5 digests (RFC2385) */
-#define TF_FASTKEEP 0x00008000 /* use a faster tcp_keepidle */
+#define TF_UNUSED01 0x00008000 /* unused */
#define TF_MORETOCOME 0x00010000 /* More data to be appended to sock */
#define TF_UNUSED00 0x00020000 /* unused */
#define TF_LASTIDLE 0x00040000 /* connection was previously idle */