From b96a262dce937736f368c85a0494cc08eab17fbb Mon Sep 17 00:00:00 2001 From: mlaier Date: Sat, 14 Jan 2006 22:19:17 +0000 Subject: Move m_adj after checking that m_dup succeeded. Found with: Coverity Prevent(tm) MFC after: 3 days --- sys/contrib/pf/net/pf_norm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/contrib/pf') diff --git a/sys/contrib/pf/net/pf_norm.c b/sys/contrib/pf/net/pf_norm.c index 7312ecd..36e210e 100644 --- a/sys/contrib/pf/net/pf_norm.c +++ b/sys/contrib/pf/net/pf_norm.c @@ -718,15 +718,16 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, */ #ifdef __FreeBSD__ *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 *m0 = m_copym2(m, 0, h->ip_hl << 2, M_NOWAIT); #endif if (*m0 == NULL) goto no_mem; #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), ("(*m0)->m_next != NULL: %s", __FUNCTION__)); -- cgit v1.1