summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-12-03 23:04:53 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-12-03 23:04:53 +0000
commit0711bbae841e87443bdaa8c183e0bed8c3dea587 (patch)
tree8a494c9466bf12d62e8a524c94e149addfa40ae3
parent401bcab56be19212fc6f11a0aede8cfe29495984 (diff)
Use arc4random_buf() rather than iterating word by wordo
itk florian
-rw-r--r--sbin/ping6/ping6.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index ca35606c9fa..70043a5ac87 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.99 2014/07/11 15:28:27 florian Exp $ */
+/* $OpenBSD: ping6.c,v 1.100 2014/12/03 23:04:52 deraadt Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
@@ -602,9 +602,7 @@ main(int argc, char *argv[])
*datap++ = i;
ident = getpid() & 0xFFFF;
- memset(nonce, 0, sizeof(nonce));
- for (i = 0; i < sizeof(nonce); i += sizeof(u_int32_t))
- *((u_int32_t *)&nonce[i]) = arc4random();
+ arc4random_buf(nonce, sizeof(nonce));
optval = 1;