summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-07-29 06:22:12 +0000
committertholo <tholo@openbsd.org>1996-07-29 06:22:12 +0000
commit32f9faca8b96dba6a8601f5c30bffc6aab6def65 (patch)
treef023e1243fae47379dcb26c49bb30522c88ede12 /sys/netinet/tcp_subr.c
parentensure bindresvport() is told to find a port (diff)
downloadwireguard-openbsd-32f9faca8b96dba6a8601f5c30bffc6aab6def65.tar.xz
wireguard-openbsd-32f9faca8b96dba6a8601f5c30bffc6aab6def65.zip
Make TCP ISS increment by random amounts
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index f5cc98bef5b..fdb7205f2b9 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.5 1996/05/15 09:32:01 mickey Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.6 1996/07/29 06:22:14 tholo Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -91,8 +91,13 @@ int tcbhashsize = TCBHASHSIZE;
void
tcp_init()
{
-
+#ifdef TCP_COMPAT_42
tcp_iss = 1; /* wrong */
+#else /* TCP_COMPAT_42 */
+ u_int random __P((void));
+
+ tcp_iss = random() + 1;
+#endif /* !TCP_COMPAT_42 */
in_pcbinit(&tcbtable, tcbhashsize);
if (max_protohdr < sizeof(struct tcpiphdr))
max_protohdr = sizeof(struct tcpiphdr);