diff options
author | kris <kris@FreeBSD.org> | 2001-04-17 18:08:01 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2001-04-17 18:08:01 +0000 |
commit | 0c55f2e6dacc3fca03b8d4e465a97fd20e434ca9 (patch) | |
tree | 230f443ebef085afc2464c22248d77ec8f649434 /sys/netinet/tcp_reass.c | |
parent | f2fbc423a1ad683d0efe728a88f7c66adff62fef (diff) | |
download | FreeBSD-src-0c55f2e6dacc3fca03b8d4e465a97fd20e434ca9.zip FreeBSD-src-0c55f2e6dacc3fca03b8d4e465a97fd20e434ca9.tar.gz |
Randomize the TCP initial sequence numbers more thoroughly.
Obtained from: OpenBSD
Reviewed by: jesper, peter, -developers
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r-- | sys/netinet/tcp_reass.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 6c7ae76..036f675 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1110,9 +1110,14 @@ findpcb: tcp_dooptions(tp, optp, optlen, th, &to); if (iss) tp->iss = iss; - else + else { +#ifdef TCP_COMPAT_42 + tcp_iss += TCP_ISSINCR/2; tp->iss = tcp_iss; - tcp_iss += TCP_ISSINCR/4; +#else + tp->iss = tcp_rndiss_next(); +#endif /* TCP_COMPAT_42 */ + } tp->irs = th->th_seq; tcp_sendseqinit(tp); tcp_rcvseqinit(tp); @@ -1643,7 +1648,11 @@ trimthenstep6: if (thflags & TH_SYN && tp->t_state == TCPS_TIME_WAIT && SEQ_GT(th->th_seq, tp->rcv_nxt)) { +#ifdef TCP_COMPAT_42 iss = tp->snd_nxt + TCP_ISSINCR; +#else + iss = tcp_rndiss_next(); +#endif /* TCP_COMPAT_42 */ tp = tcp_close(tp); goto findpcb; } |