From 7cd5333f63bdd7d0bc143af87da6184d4087baf6 Mon Sep 17 00:00:00 2001 From: damien Date: Thu, 7 Aug 2008 18:06:17 +0000 Subject: [PATCH] do not touch m after IFQ_ENQUEUE()+if_start(). ok brad@, mpf@, henning@, reyk@ --- sys/net/if_trunk.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 2bff6485767..3f06b9d4828 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.48 2008/08/06 17:04:28 reyk Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.49 2008/08/07 18:06:17 damien Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter @@ -963,16 +963,19 @@ trunk_start(struct ifnet *ifp) int trunk_enqueue(struct ifnet *ifp, struct mbuf *m) { - int error = 0; + int len, error = 0; + u_short mflags; /* Send mbuf */ + mflags = m->m_flags; + len = m->m_pkthdr.len; IFQ_ENQUEUE(&ifp->if_snd, m, NULL, error); if (error) return (error); if_start(ifp); - ifp->if_obytes += m->m_pkthdr.len; - if (m->m_flags & M_MCAST) + ifp->if_obytes += len; + if (mflags & M_MCAST) ifp->if_omcasts++; return (error); -- 2.20.1