[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Network Routing Bug



Hi All,
I think I found a small bug in the RTEMS version of the function 
m_copyback().  I am using the rtems-ss-20021118 snapshot.

The RTEMS version of the m_copyback is changing the m_len value of
the mbuf.  I looked into the source from another BSD system and
the mbuf length is not changed inside this function.  

The m_copyback function is only being used in the net/rtsock.c file.
So I think this problem is only visable under certain routing table 
conditions.  

Below is my patch to fix the problem. The uipc_mbuf.c file is located
in the cpukit/libnetworking/kern directory.  Please review and let 
me know if you think this the correct fix.

Thanks
Mike Siers

==============================================
--- uipc_mbuf.c	Sat Nov  2 10:27:43 2002
+++ uipc_mbuf.new	Thu Feb  6 08:50:46 2003
@@ -755,7 +755,7 @@
 		off = 0;
 		totlen += mlen;
 		if (len == 0) {
-			m->m_len = mlen;
+			/* m->m_len = mlen; */
 			break;
 		}
 		if (m->m_next == 0) {
@@ -767,7 +767,7 @@
 			n->m_len = min(MLEN, len);
 			m->m_next = n;
 		}
-		m->m_len = mlen;
+		/* m->m_len = mlen; */
 		m = m->m_next;
 	}
 /*out:*/