diff options
author | markm <markm@FreeBSD.org> | 2001-02-18 17:54:52 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-02-18 17:54:52 +0000 |
commit | 3f5cb3707a0bb5bcd34b9bc46e3c3dadd7b2cb34 (patch) | |
tree | d65febbc209f91841cd247a1e9775d458c998fda | |
parent | 23c92dbfc2ebcf8ce3d18a56d6bda8a27aa2cee7 (diff) | |
download | FreeBSD-src-3f5cb3707a0bb5bcd34b9bc46e3c3dadd7b2cb34.zip FreeBSD-src-3f5cb3707a0bb5bcd34b9bc46e3c3dadd7b2cb34.tar.gz |
Insert entropy harvesting calls for network traffic. By
default, no entropy will be harvested.
-rw-r--r-- | sys/net/if_ethersubr.c | 4 | ||||
-rw-r--r-- | sys/net/intrq.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 94e0541..57baa21 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -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 @@ recvLocal: #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); } /* diff --git a/sys/net/intrq.c b/sys/net/intrq.c index d05176c..89f9159 100644 --- a/sys/net/intrq.c +++ b/sys/net/intrq.c @@ -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; |