summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index b69961e..85597d9 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1473,7 +1473,6 @@ unlock_and_done:
case TCP_KEEPIDLE:
case TCP_KEEPINTVL:
- case TCP_KEEPCNT:
case TCP_KEEPINIT:
INP_WUNLOCK(inp);
error = sooptcopyin(sopt, &ui, sizeof(ui), sizeof(ui));
@@ -1506,13 +1505,6 @@ unlock_and_done:
tcp_timer_activate(tp, TT_2MSL,
TP_MAXIDLE(tp));
break;
- case TCP_KEEPCNT:
- tp->t_keepcnt = ui;
- if ((tp->t_state == TCPS_FIN_WAIT_2) &&
- (TP_MAXIDLE(tp) > 0))
- tcp_timer_activate(tp, TT_2MSL,
- TP_MAXIDLE(tp));
- break;
case TCP_KEEPINIT:
tp->t_keepinit = ui;
if (tp->t_state == TCPS_SYN_RECEIVED ||
@@ -1523,6 +1515,20 @@ unlock_and_done:
}
goto unlock_and_done;
+ case TCP_KEEPCNT:
+ INP_WUNLOCK(inp);
+ error = sooptcopyin(sopt, &ui, sizeof(ui), sizeof(ui));
+ if (error)
+ return (error);
+
+ INP_WLOCK_RECHECK(inp);
+ tp->t_keepcnt = ui;
+ if ((tp->t_state == TCPS_FIN_WAIT_2) &&
+ (TP_MAXIDLE(tp) > 0))
+ tcp_timer_activate(tp, TT_2MSL,
+ TP_MAXIDLE(tp));
+ goto unlock_and_done;
+
default:
INP_WUNLOCK(inp);
error = ENOPROTOOPT;
OpenPOWER on IntegriCloud