backout recent changes, for PR 18392.
bpf_mtap() gets called with not-well-initialized mbuf, so we need to go through it without touching m->m_pkthdr.len and such. it's part of our bpf_mtap() API (at least today).
This commit is contained in:
parent
63422177a6
commit
6a3e3549fe
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bpf.c,v 1.72 2002/09/19 03:04:32 atatat Exp $ */
|
||||
/* $NetBSD: bpf.c,v 1.73 2002/09/24 03:14:43 itojun Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990, 1991, 1993
|
||||
@ -43,7 +43,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.72 2002/09/19 03:04:32 atatat Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.73 2002/09/24 03:14:43 itojun Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
||||
@ -1130,18 +1130,9 @@ bpf_mtap(arg, m)
|
||||
u_int pktlen, slen;
|
||||
struct mbuf *m0;
|
||||
|
||||
if ((m->m_flags & M_PKTHDR) != 0) {
|
||||
pktlen = m->m_pkthdr.len;
|
||||
} else {
|
||||
pktlen = 0;
|
||||
for (m0 = m; m0 != 0; m0 = m0->m_next)
|
||||
pktlen += m0->m_len;
|
||||
}
|
||||
|
||||
if (pktlen == m->m_len) {
|
||||
bpf_tap(arg, mtod(m, u_char *), pktlen);
|
||||
return;
|
||||
}
|
||||
pktlen = 0;
|
||||
for (m0 = m; m0 != 0; m0 = m0->m_next)
|
||||
pktlen += m0->m_len;
|
||||
|
||||
for (d = bp->bif_dlist; d != 0; d = d->bd_next) {
|
||||
++d->bd_rcount;
|
||||
|
Loading…
x
Reference in New Issue
Block a user