Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Aug 2009 19:35:31 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 167412 for review
Message-ID:  <200908161935.n7GJZVEF012059@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167412

Change 167412 by bz@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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908161935.n7GJZVEF012059>