mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
Insert entropy harvesting calls for network traffic. By
default, no entropy will be harvested.
This commit is contained in:
parent
2564fe499d
commit
10b1fde07f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72669
@ -46,6 +46,7 @@
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/random.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/sysctl.h>
|
||||
@ -474,6 +475,9 @@ ether_input(ifp, eh, m)
|
||||
#endif
|
||||
/* Continue with upper layer processing */
|
||||
ether_demux(ifp, eh, m);
|
||||
/* First chunk of an mbuf contains good junk */
|
||||
if (harvest.ethernet)
|
||||
random_harvest(m, 16, 3, 0, RANDOM_NET);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/random.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/time.h>
|
||||
@ -90,6 +91,9 @@ family_enqueue(family, m)
|
||||
if (! IF_HANDOFF(queue[entry].q, m, NULL))
|
||||
return ENOBUFS;
|
||||
schednetisr(queue[entry].isr);
|
||||
/* First chunk of an mbuf contains good junk */
|
||||
if (harvest.point_to_point)
|
||||
random_harvest(m, 16, 3, 0, RANDOM_NET);
|
||||
return 0;
|
||||
} else
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user