diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-07-29 06:22:16 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-07-29 06:22:16 +0000 |
commit | f4c1df812bce004b8ef7a3daf07d0c2f1465f264 (patch) | |
tree | 6345a01cbfc00250194b81b8fa938d9c1e040265 /sys/netinet/tcp_input.c | |
parent | 113188295a043c61062195aafecf8391da5c09ca (diff) |
Make TCP ISS increment by random amounts
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9db513df8dd..6b1e52774f8 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.3 1996/03/03 22:30:45 niklas Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.4 1996/07/29 06:22:12 tholo Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -243,6 +243,9 @@ tcp_input(m, va_alist) register struct mbuf *m; #endif { +#ifndef TCP_COMPAT_42 + u_int random __P((void)); +#endif /* !TCP_COMPAT_42 */ register struct tcpiphdr *ti; register struct inpcb *inp; caddr_t optp = NULL; @@ -619,7 +622,11 @@ findpcb: tp->iss = iss; else tp->iss = tcp_iss; +#ifdef TCP_COMPAT_42 tcp_iss += TCP_ISSINCR/2; +#else /* TCP_COMPAT_42 */ + tcp_iss += random() % (TCP_ISSINCR / 2) + 1; +#endif /* !TCP_COMPAT_42 */ tp->irs = ti->ti_seq; tcp_sendseqinit(tp); tcp_rcvseqinit(tp); |