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_usrreq.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_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index e484d1afce5..c9917e64290 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.4 1996/07/25 09:46:12 deraadt Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.5 1996/07/29 06:22:15 tholo Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -85,6 +85,9 @@ tcp_usrreq(so, req, m, nam, control) int req; struct mbuf *m, *nam, *control; { +#ifndef TCP_COMPAT_42 + u_int random __P((void)); +#endif /* !TCP_COMPAT_42 */ register struct inpcb *inp; register struct tcpcb *tp = NULL; int s; @@ -210,7 +213,12 @@ tcp_usrreq(so, req, m, nam, control) tcpstat.tcps_connattempt++; tp->t_state = TCPS_SYN_SENT; tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; - tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2; + 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 */ tcp_sendseqinit(tp); error = tcp_output(tp); break; |