aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2000-10-06 20:45:14 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2000-10-06 20:45:14 +0000
commit6cde93ecea1bb6cbeebee8c27d86b5df72b7c383 (patch)
treec25bcea1007c318bf99def82e4eb9b99518a46ee
parent9ebad99211663e1b3c4d4d04a1bce58010c3e7d2 (diff)
Notes
-rw-r--r--sys/i386/conf/files.i3861
-rw-r--r--sys/libkern/arc4random.c1
-rw-r--r--sys/netinet/tcp_seq.h2
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/sys/libkern.h1
5 files changed, 4 insertions, 3 deletions
diff --git a/sys/i386/conf/files.i386 b/sys/i386/conf/files.i386
index 29f7edd41b65..d49b1b533416 100644
--- a/sys/i386/conf/files.i386
+++ b/sys/i386/conf/files.i386
@@ -256,6 +256,7 @@ libkern/strncmp.c standard
libkern/strncpy.c standard
libkern/udivdi3.c standard
libkern/umoddi3.c standard
+libkern/arc4random.c standard
gnu/i386/fpemul/div_small.s optional gpl_math_emulate
gnu/i386/fpemul/errors.c optional gpl_math_emulate
gnu/i386/fpemul/fpu_arith.c optional gpl_math_emulate
diff --git a/sys/libkern/arc4random.c b/sys/libkern/arc4random.c
index 9abba830a925..b03ea9ee09e5 100644
--- a/sys/libkern/arc4random.c
+++ b/sys/libkern/arc4random.c
@@ -11,7 +11,6 @@
*/
#include <sys/types.h>
-#include <sys/random.h>
#include <sys/libkern.h>
#define ARC4_MAXRUNS 64
diff --git a/sys/netinet/tcp_seq.h b/sys/netinet/tcp_seq.h
index 0ad0fb838be1..9392df7be6fc 100644
--- a/sys/netinet/tcp_seq.h
+++ b/sys/netinet/tcp_seq.h
@@ -91,7 +91,7 @@ extern tcp_cc tcp_ccgen; /* global connection count */
* number in the range [0-0x3ffff] that is hard to predict.
*/
#ifndef tcp_random18
-#define tcp_random18() ((random() >> 14) & 0x3ffff)
+#define tcp_random18() (arc4random() & 0x3ffff)
#endif
#define TCP_ISSINCR (122*1024 + tcp_random18())
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index f7f07258c6b1..b5609a66b51f 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -104,7 +104,7 @@ void
tcp_init()
{
- tcp_iss = random(); /* wrong, but better than a constant */
+ tcp_iss = arc4random(); /* wrong, but better than a constant */
tcp_ccgen = 1;
tcp_cleartaocache();
LIST_INIT(&tcb);
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
index 6f7c4ae90a59..41d1a1bf888e 100644
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -61,6 +61,7 @@ static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); }
static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); }
/* Prototypes for non-quad routines. */
+u_int32_t arc4random __P((void));
int bcmp __P((const void *, const void *, size_t));
#ifndef HAVE_INLINE_FFS
int ffs __P((int));