PERFORCE change 167412 for review
Bjoern A. Zeeb
bz at FreeBSD.org
Sun Aug 16 19:35:31 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167412
Change 167412 by bz at bz_zoo on 2009/08/16 19:35:30
Use m_copyback() to add the data to the mbuf rather than having
an implicit memory assumption that the additional payload will either
fit into the mbuf already there or an additional of size MT_DATA
(256 bytes).
This should solve memory corruptions in the mbuf of the next
chunk of memory.
Affected files ...
.. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#17 edit
Differences ...
==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#17 (text+ko) ====
@@ -1276,6 +1276,8 @@
* NB: we assume m is a single mbuf.
*/
+ m_copyback(m, m->m_len, data_len, data);
+#if 0
if (data_len > M_TRAILINGSPACE(m)) {
struct mbuf *n = m_get(M_NOWAIT, MT_DATA);
if (n == NULL) {
@@ -1299,6 +1301,7 @@
}
if (m->m_flags & M_PKTHDR)
m->m_pkthdr.len += data_len;
+#endif
printf("prije mtod!\n");
mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len;
printf("prije rt_dispatch\n");
More information about the p4-projects
mailing list