projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
022f915
)
tcp: Reset keepalive timer, if TCP_KEEPIDLE is changed
author
Sepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 19 Apr 2012 06:57:36 +0000 (14:57 +0800)
committer
Sepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 19 Apr 2012 06:57:36 +0000 (14:57 +0800)
This would cause side effect, if the keepalive probing was underway.
Correcting this side effect could become overkill, so it is suggested
that TCP_KEEPIDLE is set before connect(2) or listen(2).
sys/netinet/tcp_usrreq.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/netinet/tcp_usrreq.c
b/sys/netinet/tcp_usrreq.c
index
fe46bc4
..
1b3eb0c
100644
(file)
--- a/
sys/netinet/tcp_usrreq.c
+++ b/
sys/netinet/tcp_usrreq.c
@@
-1428,10
+1428,12
@@
tcp_ctloutput(netmsg_t msg)
case TCP_KEEPIDLE:
opthz = ((int64_t)optval * hz) / 1000;
- if (opthz >= 1)
+ if (opthz >= 1) {
tp->t_keepidle = opthz;
- else
+ tcp_timer_keep_activity(tp, 0);
+ } else {
error = EINVAL;
+ }
break;
case TCP_KEEPINTVL: