summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-18 20:22:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-11-18 20:22:24 +0000
commit6cbe8bc463a4982b1bc2c4a8c6648307240e4745 (patch)
tree0df077242bed47165f489859358065a78bdbfd90 /sys/net
parent34f42c48d1fdabc4198ec57554652a5de2784927 (diff)
use arc4random() for ether_fakeaddr, because it is safe
ok tedu
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index cf138a3782b..2fefd205ef9 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.158 2013/10/23 15:12:42 mpi Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.159 2013/11/18 20:22:23 deraadt Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -751,14 +751,13 @@ void
ether_fakeaddr(struct ifnet *ifp)
{
static int unit;
- int rng;
+ int rng = arc4random();
/* Non-multicast; locally administered address */
((struct arpcom *)ifp)->ac_enaddr[0] = 0xfe;
((struct arpcom *)ifp)->ac_enaddr[1] = 0xe1;
((struct arpcom *)ifp)->ac_enaddr[2] = 0xba;
((struct arpcom *)ifp)->ac_enaddr[3] = 0xd0 | (unit++ & 0xf);
- rng = cold ? random() ^ (long)ifp : arc4random();
((struct arpcom *)ifp)->ac_enaddr[4] = rng;
((struct arpcom *)ifp)->ac_enaddr[5] = rng >> 8;
}