svn commit: r257548 - in head/sys: net netgraph

Adrian Chadd adrian at FreeBSD.org
Sat Nov 2 15:13:03 UTC 2013


Author: adrian
Date: Sat Nov  2 15:13:02 2013
New Revision: 257548
URL: http://svnweb.freebsd.org/changeset/base/257548

Log:
  Restore the entropy gathering from the m_data pointer value, not the
  m_data payload.
  
  After talking with markm/bde, this is what markm actually intended.

Modified:
  head/sys/net/if_ethersubr.c
  head/sys/net/if_tun.c
  head/sys/netgraph/ng_iface.c

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Sat Nov  2 14:20:29 2013	(r257547)
+++ head/sys/net/if_ethersubr.c	Sat Nov  2 15:13:02 2013	(r257548)
@@ -642,7 +642,7 @@ ether_input_internal(struct ifnet *ifp, 
 	}
 
 	if (harvest.ethernet)
-		random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_ETHER);
+		random_harvest(&(m->m_data), 12, 2, RANDOM_NET_ETHER);
 
 	ether_demux(ifp, m);
 	CURVNET_RESTORE();

Modified: head/sys/net/if_tun.c
==============================================================================
--- head/sys/net/if_tun.c	Sat Nov  2 14:20:29 2013	(r257547)
+++ head/sys/net/if_tun.c	Sat Nov  2 15:13:02 2013	(r257548)
@@ -919,7 +919,7 @@ tunwrite(struct cdev *dev, struct uio *u
 		return (EAFNOSUPPORT);
 	}
 	if (harvest.point_to_point)
-		random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_TUN);
+		random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN);
 	ifp->if_ibytes += m->m_pkthdr.len;
 	ifp->if_ipackets++;
 	CURVNET_SET(ifp->if_vnet);

Modified: head/sys/netgraph/ng_iface.c
==============================================================================
--- head/sys/netgraph/ng_iface.c	Sat Nov  2 14:20:29 2013	(r257547)
+++ head/sys/netgraph/ng_iface.c	Sat Nov  2 15:13:02 2013	(r257548)
@@ -776,7 +776,7 @@ ng_iface_rcvdata(hook_p hook, item_p ite
 		return (EAFNOSUPPORT);
 	}
 	if (harvest.point_to_point)
-		random_harvest(mtod(m, const void *), 12, 2, RANDOM_NET_NG);
+		random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG);
 	M_SETFIB(m, ifp->if_fib);
 	netisr_dispatch(isr, m);
 	return (0);


More information about the svn-src-head mailing list