tcp: Reset keepalive timer, if TCP_KEEPIDLE is changed
[dragonfly.git] / sys / netinet / tcp_usrreq.c
index fe46bc4..1b3eb0c 100644 (file)
@@ -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: