diff options
-rw-r--r-- | sys/netinet/tcp_timer.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 74752b8..591fb18 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -71,17 +71,13 @@ sysctl_msec_to_ticks SYSCTL_HANDLER_ARGS tt = *(int *)oidp->oid_arg1; s = tt * 1000 / hz; - error = SYSCTL_OUT(req, &s, sizeof(int)); + error = sysctl_handle_int(oidp, &s, 0, req); if (error || !req->newptr) return (error); - error = SYSCTL_IN(req, &s, sizeof(int)); - if (error) - return (error); - tt = s * hz / 1000; - if (tt == 0 && s > 0) - tt++; + if (tt < 1) + return (EINVAL); *(int *)oidp->oid_arg1 = tt; return (0); |