-/* $OpenBSD: if.c,v 1.333 2015/05/20 08:28:54 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.334 2015/05/26 11:36:26 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
#include <sys/sysctl.h>
#include <sys/task.h>
+#include <dev/rndvar.h>
+
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
if (ml_empty(&ml))
return;
+ add_net_randomness(ml_len(&ml));
+
KERNEL_LOCK();
s = splnet();
while ((m = ml_dequeue(&ml)) != NULL) {
-/* $OpenBSD: if_ethersubr.c,v 1.199 2015/05/19 11:09:24 mpi Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.200 2015/05/26 11:36:26 dlg Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
#include <netinet/if_ether.h>
#include <netinet/ip_ipsp.h>
-#include <dev/rndvar.h>
-
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
etype = ntohs(eh->ether_type);
- if (!(netisr & (1 << NETISR_RND_DONE))) {
- add_net_randomness(etype);
- atomic_setbits_int(&netisr, (1 << NETISR_RND_DONE));
- }
-
#if NBRIDGE > 0
/*
* Tap the packet off here for a bridge, if configured and
-/* $OpenBSD: if_tun.c,v 1.143 2015/05/20 08:28:54 mpi Exp $ */
+/* $OpenBSD: if_tun.c,v 1.144 2015/05/26 11:36:26 dlg Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
#endif
if (tp->tun_flags & TUN_LAYER2) {
- /* quirk to not add randomness from a virtual device */
- atomic_setbits_int(&netisr, (1 << NETISR_RND_DONE));
-
s = splnet();
ether_input_mbuf(ifp, top);
splx(s);
-/* $OpenBSD: netisr.h,v 1.40 2014/08/10 07:28:32 guenther Exp $ */
+/* $OpenBSD: netisr.h,v 1.41 2015/05/26 11:36:26 dlg Exp $ */
/* $NetBSD: netisr.h,v 1.12 1995/08/12 23:59:24 mycroft Exp $ */
/*
* interrupt used for scheduling the network code to calls
* on the lowest level routine of each protocol.
*/
-#define NETISR_RND_DONE 1
#define NETISR_IP 2 /* same as AF_INET */
#define NETISR_TX 3 /* for if_snd processing */
#define NETISR_MPLS 4 /* AF_MPLS would overflow */