summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_id.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-02 21:38:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-03-02 21:38:19 +0000
commitdab86171f41996643a0e3c5f00b2b4e03e7de179 (patch)
treeba9c35d97dd469259dc688b985308d4d5859fb17 /sys/netinet/ip_id.c
parent651ffa5adcb99a62ece90b467f06f8a9a55ca894 (diff)
because arc4random_uniform is being used, the modulo bias is taken care of
Diffstat (limited to 'sys/netinet/ip_id.c')
-rw-r--r--sys/netinet/ip_id.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c
index b75d79940b7..07834dfcd25 100644
--- a/sys/netinet/ip_id.c
+++ b/sys/netinet/ip_id.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_id.c,v 1.17 2008/03/02 21:29:07 djm Exp $ */
+/* $OpenBSD: ip_id.c,v 1.18 2008/03/02 21:38:18 deraadt Exp $ */
/*
* Copyright (c) 2008 Theo de Raadt, Ryan McBride
@@ -58,7 +58,6 @@ ip_randomid(void)
for (i = 0; i < sizeof(ip_shuffle)/sizeof(ip_shuffle[0]); ++i)
ip_shuffle[i] = i;
for (i = sizeof(ip_shuffle)/sizeof(ip_shuffle[0]); --i; ) {
- /* disregard the modulo bias because it is small */
i2 = arc4random_uniform(i + 1);
r = ip_shuffle[i];
ip_shuffle[i] = ip_shuffle[i2];