summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-04-24 06:00:35 +0000
committerderaadt <deraadt@openbsd.org>2013-04-24 06:00:35 +0000
commitf55ecb92138c674375bbf537e1d7a1b897209d1c (patch)
tree9bb216a5e97356a338180c096c20b790b4a4608a
parentFollow ISC and freebsd by increasing ip_ttl on packets from 16 to (diff)
downloadwireguard-openbsd-f55ecb92138c674375bbf537e1d7a1b897209d1c.tar.xz
wireguard-openbsd-f55ecb92138c674375bbf537e1d7a1b897209d1c.zip
kill srandom(); ok claudio
-rw-r--r--usr.sbin/mtrace/mtrace.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c
index d4f91d8d7fa..edaf30fdb30 100644
--- a/usr.sbin/mtrace/mtrace.c
+++ b/usr.sbin/mtrace/mtrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtrace.c,v 1.30 2013/04/20 19:21:46 deraadt Exp $ */
+/* $OpenBSD: mtrace.c,v 1.31 2013/04/24 06:00:35 deraadt Exp $ */
/* $NetBSD: mtrace.c,v 1.5 1995/12/10 10:57:15 mycroft Exp $ */
/*
@@ -419,11 +419,7 @@ send_recv(u_int32_t dst, int type, int code, int tries, struct resp_buf *save)
* Change the qid for each request sent to avoid being confused
* by duplicate responses
*/
-#ifdef SYSV
- query->tr_qid = ((u_int32_t)lrand48() >> 8);
-#else
- query->tr_qid = ((u_int32_t)random() >> 8);
-#endif
+ query->tr_qid = arc4random();
/*
* Set timer to calculate delays, then send query
@@ -1119,7 +1115,6 @@ main(int argc, char *argv[])
u_int32_t lastout = 0;
int numstats = 1;
int waittime;
- int seed;
uid_t uid;
init_igmp();
@@ -1331,17 +1326,6 @@ usage: mtrace [-lMnpsv] [-g gateway] [-i if_addr] [-m max_hops] [-q nqueries]\n\
if (lcl_addr == 0) lcl_addr = addr.sin_addr.s_addr;
/*
- * Initialize the seed for random query identifiers.
- */
- gettimeofday(&tv, 0);
- seed = tv.tv_usec ^ lcl_addr;
-#ifdef SYSV
- srand48(seed);
-#else
- srandom(seed);
-#endif
-
- /*
* Protect against unicast queries to mrouted versions that might crash.
*/
if (gwy && !IN_MULTICAST(ntohl(gwy)))