-/* $OpenBSD: tcp_timer.c,v 1.63 2018/02/06 15:13:08 bluhm Exp $ */
+/* $OpenBSD: tcp_timer.c,v 1.64 2018/02/07 00:31:10 bluhm Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
* Time to delay the ACK. This is initialized in tcp_init(), unless
* its patched.
*/
-int tcp_delack_ticks;
+int tcp_delack_msecs;
void tcp_timer_rexmt(void *);
void tcp_timer_persist(void *);
if (tcp_maxpersistidle == 0)
tcp_maxpersistidle = TCPTV_KEEP_IDLE;
- if (tcp_delack_ticks == 0)
- tcp_delack_ticks = TCP_DELACK_TICKS;
+ if (tcp_delack_msecs == 0)
+ tcp_delack_msecs = TCP_DELACK_MSECS;
}
/*
-/* $OpenBSD: tcp_timer.h,v 1.16 2018/02/06 15:13:08 bluhm Exp $ */
+/* $OpenBSD: tcp_timer.h,v 1.17 2018/02/07 00:31:10 bluhm Exp $ */
/* $NetBSD: tcp_timer.h,v 1.6 1995/03/26 20:32:37 jtc Exp $ */
/*
#define TCP_MAXRXTSHIFT 12 /* maximum retransmits */
-#define TCP_DELACK_TICKS (hz / PR_FASTHZ) /* time to delay ACK */
+#define TCP_DELACK_MSECS 200 /* time to delay ACK */
#ifdef TCPTIMERS
const char *tcptimers[TCPT_NTIMERS] =
#define TCP_TIMER_ARM(tp, timer, nticks) \
do { \
SET((tp)->t_flags, TF_TIMER << (timer)); \
- timeout_add(&(tp)->t_timer[(timer)], (nticks) * (hz / PR_SLOWHZ)); \
+ timeout_add_msec(&(tp)->t_timer[(timer)], (nticks) * 500); \
} while (0)
#define TCP_TIMER_DISARM(tp, timer) \
extern const tcp_timer_func_t tcp_timer_funcs[TCPT_NTIMERS];
+extern int tcp_delack_msecs; /* delayed ACK timeout in millisecs */
extern int tcptv_keep_init;
extern int tcp_always_keepalive; /* assume SO_KEEPALIVE is always set */
extern int tcp_keepidle; /* time before keepalive probes begin */
-/* $OpenBSD: tcp_var.h,v 1.130 2018/02/06 15:13:08 bluhm Exp $ */
+/* $OpenBSD: tcp_var.h,v 1.131 2018/02/07 00:31:10 bluhm Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/*
#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
#ifdef _KERNEL
-extern int tcp_delack_ticks;
void tcp_delack(void *);
#define TCP_INIT_DELACK(tp) \
timeout_set_proc(&(tp)->t_delack_to, tcp_delack, tp)
#define TCP_RESTART_DELACK(tp) \
- timeout_add(&(tp)->t_delack_to, tcp_delack_ticks)
+ timeout_add_msec(&(tp)->t_delack_to, tcp_delack_msecs)
#define TCP_SET_DELACK(tp) \
do { \