Use m_length() instead of home-rolled.
In bpf_mtap(), if the entire packet is in one mbuf, call bpf_tap() instead since it is a tad faster. Sponsored by: http://www.babeltech.dk/
This commit is contained in:
parent
7ed60de837
commit
f0e2422b1b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103555
@ -1123,11 +1123,10 @@ bpf_mtap(ifp, m)
|
||||
struct bpf_if *bp = ifp->if_bpf;
|
||||
struct bpf_d *d;
|
||||
u_int pktlen, slen;
|
||||
struct mbuf *m0;
|
||||
|
||||
pktlen = 0;
|
||||
for (m0 = m; m0 != 0; m0 = m0->m_next)
|
||||
pktlen += m0->m_len;
|
||||
pktlen = m_length(m, NULL);
|
||||
if (pktlen == m->m_len)
|
||||
return(bpf_tap(ifp, mtod(m, u_char *), pktlen));
|
||||
|
||||
BPFIF_LOCK(bp);
|
||||
for (d = bp->bif_dlist; d != 0; d = d->bd_next) {
|
||||
|
Loading…
Reference in New Issue
Block a user