Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2008 00:03:46 GMT
From:      Andre Oppermann <andre@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 133290 for review
Message-ID:  <200801150003.m0F03k85079690@repoman.freebsd.org>

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

Change 133290 by andre@andre_flirtbox on 2008/01/15 00:03:16

	Fix mbuf accounting.

Affected files ...

.. //depot/projects/tcp_reass/netinet/tcp_reass.c#6 edit

Differences ...

==== //depot/projects/tcp_reass/netinet/tcp_reass.c#6 (text+ko) ====

@@ -142,7 +142,7 @@
 	struct trq *tqe, *tqen;
 	struct socket *so = tp->t_inpcb->inp_socket;
 	struct mbuf *n;
-	int i, flags = 0, mcnt = 0;
+	int i, flags = 0, mcnt;
 
 	INP_LOCK_ASSERT(tp->t_inpcb);
 
@@ -184,7 +184,7 @@
 	}
 
 	/* NB: m_adj(m, -i) may free mbufs at the tail of a chain. */
-	for (n = m; n; n = n->m_next)
+	for (mcnt = 0, n = m; n; n = n->m_next)
 		mcnt += (n->m_flags & M_EXT) ? n->m_ext.ext_size : MSIZE;
 
 	/* Get rid of packet header and mtags. */
@@ -220,7 +220,7 @@
 				tcpstat.tcps_rcvpartduppack++;
 				tcpstat.tcps_rcvpartdupbyte -= i;
 				/* Update accounting. */
-				for (n = m; n; n = n->m_next)
+				for (mcnt = 0, n = m; n; n = n->m_next)
 					mcnt += (n->m_flags & M_EXT) ?
 					    n->m_ext.ext_size : MSIZE;
 			}
@@ -307,7 +307,7 @@
 				tcpstat.tcps_rcvpartduppack++;
 				tcpstat.tcps_rcvpartdupbyte -= i;
 				/* Update accounting. */
-				for (n = m; n; n = n->m_next)
+				for (mcnt = 0, n = m; n; n = n->m_next)
 					mcnt += (n->m_flags & M_EXT) ?
 					    n->m_ext.ext_size : MSIZE;
 			}



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