-/* $OpenBSD: igmp.c,v 1.2 1996/03/03 22:30:26 niklas Exp $ */
+/* $OpenBSD: igmp.c,v 1.3 1997/02/05 15:48:21 deraadt Exp $ */
/* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */
/*
#include <netinet/ip_var.h>
#include <netinet/igmp.h>
#include <netinet/igmp_var.h>
+#include <dev/rndvar.h>
#include <machine/stdarg.h>
-/* $OpenBSD: igmp_var.h,v 1.2 1996/03/03 22:30:27 niklas Exp $ */
+/* $OpenBSD: igmp_var.h,v 1.3 1997/02/05 15:48:22 deraadt Exp $ */
/* $NetBSD: igmp_var.h,v 1.9 1996/02/13 23:41:31 christos Exp $ */
/*
* DELAY * countdown frequency). We assume that the routine random()
* is defined somewhere (and that it returns a positive number).
*/
-#define IGMP_RANDOM_DELAY(X) (random() % (X) + 1)
+#define IGMP_RANDOM_DELAY(X) (arc4random() % (X) + 1)
void igmp_init __P((void));
void igmp_input __P((struct mbuf *, ...));
-/* $OpenBSD: in_pcb.c,v 1.13 1997/01/15 03:27:14 kstailey Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.14 1997/02/05 15:48:23 deraadt Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
#include <netinet/in_pcb.h>
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
+#include <dev/rndvar.h>
struct in_addr zeroin_addr;
*/
if (loopcount == 0) { /* only do this once. */
old = first;
- first -= (random() % (first - last));
+ first -= (arc4random() % (first - last));
}
count = first - last;
*/
if (loopcount == 0) { /* only do this once. */
old = first;
- first += (random() % (last - first));
+ first += (arc4random() % (last - first));
}
count = last - first;
-/* $OpenBSD: tcp_input.c,v 1.8 1996/09/25 11:39:56 niklas Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.9 1997/02/05 15:48:24 deraadt Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
#include <netinet/tcp_debug.h>
+#include <dev/rndvar.h>
#include <machine/stdarg.h>
#ifdef TCP_COMPAT_42
tcp_iss += TCP_ISSINCR/2;
#else /* TCP_COMPAT_42 */
- tcp_iss += random() % (TCP_ISSINCR / 2) + 1;
+ tcp_iss += arc4random() % (TCP_ISSINCR / 2) + 1;
#endif /* !TCP_COMPAT_42 */
tp->irs = ti->ti_seq;
tcp_sendseqinit(tp);
-/* $OpenBSD: tcp_subr.c,v 1.7 1996/07/29 22:01:50 niklas Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.8 1997/02/05 15:48:25 deraadt Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
+#include <dev/rndvar.h>
/* patchable/settable parameters for tcp */
int tcp_mssdflt = TCP_MSS;
#ifdef TCP_COMPAT_42
tcp_iss = 1; /* wrong */
#else /* TCP_COMPAT_42 */
- tcp_iss = random() + 1;
+ tcp_iss = arc4random() + 1;
#endif /* !TCP_COMPAT_42 */
in_pcbinit(&tcbtable, tcbhashsize);
if (max_protohdr < sizeof(struct tcpiphdr))
-/* $OpenBSD: tcp_timer.c,v 1.6 1996/09/12 06:19:57 tholo Exp $ */
+/* $OpenBSD: tcp_timer.c,v 1.7 1997/02/05 15:48:26 deraadt Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
+#include <dev/rndvar.h>
int tcp_keepidle = TCPTV_KEEP_IDLE;
int tcp_keepintvl = TCPTV_KEEPINTVL;
if ((int)tcp_iss < 0)
tcp_iss = 0; /* XXX */
#else /* TCP_COMPAT_42 */
- tcp_iss += random() % (TCP_ISSINCR / PR_SLOWHZ) + 1; /* increment iss */
+ tcp_iss += arc4random() % (TCP_ISSINCR / PR_SLOWHZ) + 1; /* increment iss */
#endif /* !TCP_COMPAT_42 */
tcp_now++; /* for timestamps */
splx(s);
-/* $OpenBSD: tcp_usrreq.c,v 1.7 1996/09/20 22:53:12 deraadt Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.8 1997/02/05 15:48:27 deraadt Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
#include <netinet/tcp_debug.h>
+#include <dev/rndvar.h>
/*
* TCP protocol interface to socket abstraction.
#ifdef TCP_COMPAT_42
tcp_iss += TCP_ISSINCR/2;
#else /* TCP_COMPAT_42 */
- tcp_iss += random() % (TCP_ISSINCR / 2) + 1;
+ tcp_iss += arc4random() % (TCP_ISSINCR / 2) + 1;
#endif /* !TCP_COMPAT_42 */
tcp_sendseqinit(tp);
error = tcp_output(tp);