Move m_adj after checking that m_dup succeeded.

Found with:	Coverity Prevent(tm)
MFC after:	3 days
This commit is contained in:
Max Laier 2006-01-14 22:19:17 +00:00
parent 929d59e2fe
commit 4cd9957a80

View File

@ -718,15 +718,16 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff,
*/ */
#ifdef __FreeBSD__ #ifdef __FreeBSD__
*m0 = m_dup(m, M_DONTWAIT); *m0 = m_dup(m, M_DONTWAIT);
/* From KAME Project : We have missed this! */
m_adj(*m0, (h->ip_hl << 2) -
(*m0)->m_pkthdr.len);
#else #else
*m0 = m_copym2(m, 0, h->ip_hl << 2, M_NOWAIT); *m0 = m_copym2(m, 0, h->ip_hl << 2, M_NOWAIT);
#endif #endif
if (*m0 == NULL) if (*m0 == NULL)
goto no_mem; goto no_mem;
#ifdef __FreeBSD__ #ifdef __FreeBSD__
/* From KAME Project : We have missed this! */
m_adj(*m0, (h->ip_hl << 2) -
(*m0)->m_pkthdr.len);
KASSERT(((*m0)->m_next == NULL), KASSERT(((*m0)->m_next == NULL),
("(*m0)->m_next != NULL: %s", ("(*m0)->m_next != NULL: %s",
__FUNCTION__)); __FUNCTION__));