From b500521e55657cc907a3471c4c7dda3c7266054e Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 1 May 2006 16:25:41 +0000 Subject: [PATCH] m_cat() may free the mbuf on 2nd arg, so m_pkthdr manipulation has to happen before the call to m_cat(). [May not apply.] Fix IPv6 error statistics being recorded as IPv4. Submitted-by: Gary Allan Taken-from: FreeBSD4 --- sys/netinet6/ah_input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c index 87d7d484cb..6efe8bdf4d 100644 --- a/sys/netinet6/ah_input.c +++ b/sys/netinet6/ah_input.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ah_input.c,v 1.1.2.6 2002/04/28 05:40:26 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/ah_input.c,v 1.10 2004/11/30 19:21:26 joerg Exp $ */ +/* $DragonFly: src/sys/netinet6/ah_input.c,v 1.11 2006/05/01 16:25:41 dillon Exp $ */ /* $KAME: ah_input.c,v 1.67 2002/01/07 11:39:56 kjc Exp $ */ /* @@ -502,9 +502,9 @@ ah4_input(struct mbuf *m, ...) goto fail; } m_adj(n, stripsiz); - m_cat(m, n); /* m_cat does not update m_pkthdr.len */ m->m_pkthdr.len += n->m_pkthdr.len; + m_cat(m, n); } #endif @@ -857,7 +857,7 @@ ah6_input(struct mbuf **mp, int *offp, int proto) } if (netisr_queue(NETISR_IPV6, m)) { - ipsecstat.in_inval++; + ipsec6stat.in_inval++; m = NULL; goto fail; } @@ -910,9 +910,9 @@ ah6_input(struct mbuf **mp, int *offp, int proto) goto fail; } m_adj(n, stripsiz); - m_cat(m, n); /* m_cat does not update m_pkthdr.len */ m->m_pkthdr.len += n->m_pkthdr.len; + m_cat(m, n); } #endif ip6 = mtod(m, struct ip6_hdr *); -- 2.41.0