diff options
author | 1996-07-29 06:22:12 +0000 | |
---|---|---|
committer | 1996-07-29 06:22:12 +0000 | |
commit | 32f9faca8b96dba6a8601f5c30bffc6aab6def65 (patch) | |
tree | f023e1243fae47379dcb26c49bb30522c88ede12 /sys/netinet/tcp_timer.c | |
parent | ensure bindresvport() is told to find a port (diff) | |
download | wireguard-openbsd-32f9faca8b96dba6a8601f5c30bffc6aab6def65.tar.xz wireguard-openbsd-32f9faca8b96dba6a8601f5c30bffc6aab6def65.zip |
Make TCP ISS increment by random amounts
Diffstat (limited to 'sys/netinet/tcp_timer.c')
-rw-r--r-- | sys/netinet/tcp_timer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 1b2cfaf3680..a1fecdc5383 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_timer.c,v 1.3 1996/03/14 08:09:49 tholo Exp $ */ +/* $OpenBSD: tcp_timer.c,v 1.4 1996/07/29 06:22:14 tholo Exp $ */ /* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */ /* @@ -99,6 +99,9 @@ tcp_fasttimo() void tcp_slowtimo() { +#ifndef TCP_COMPAT_42 + u_int random __P((void)); +#endif /* !TCP_COMPAT_42 */ register struct inpcb *ip, *ipnxt; register struct tcpcb *tp; int s; @@ -137,11 +140,13 @@ tcp_slowtimo() tpgone: ; } - tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */ #ifdef TCP_COMPAT_42 + tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */ if ((int)tcp_iss < 0) tcp_iss = 0; /* XXX */ -#endif +#else /* TCP_COMPAT_42 */ + tcp_iss += random() % (TCP_ISSINCR / PR_SLOWHZ) + 1; /* increment iss */ +#endif /* !TCP_COMPAT_42 */ tcp_now++; /* for timestamps */ splx(s); } |