summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2008-08-07 18:06:18 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2008-08-07 18:06:18 +0000
commit6523e512410347412a8eb1c3ffc36281b4a54ed8 (patch)
tree58b595a0100ab42df1470a79e83da7493c0d8d06 /sys
parentf56164569dcc10a8ac839221c27a2d523d24c85b (diff)
do not touch m after IFQ_ENQUEUE()+if_start().
ok brad@, mpf@, henning@, reyk@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_trunk.c11
1 files 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 <reyk@openbsd.org>
@@ -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);