| Summary: | bpf_tap() used incorrectly in bpf | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Vladimir Yu. Stepanov <vys> |
| Component: | kern | Assignee: | Andre Oppermann <andre> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | CC: | vys |
| Priority: | Normal | ||
| Version: | 5.0-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
Responsible Changed From-To: gnats-admin->freebsd-bugs Reassign misfiled PR. Responsible Changed From-To: freebsd-bugs->andre Take over. State Changed From-To: open->patched Patch committed in sys/net/bpf.c rev. 1.160. MFC pending. State Changed From-To: patched->closed MFC to RELENG_6 and RELENG_5 done. |
In file 'sys/net/bpf.c' have a error introduced in CVS revision 1.95. This error is critical for the programs with used flag BIOCGSEESENT. Locally generated packet may be copied in user space if flag BIOCGSEESENT set to one. Function 'bpf_tap' must be used only for incoming packets. But function 'bpf_mtap' uses 'bpf_tap'. It is fast. But it's wrong. How-To-Repeat: diff -ruN sys.orig/net/bpf.c sys/net/bpf.c --- sys.orig/net/bpf.c Thu Aug 28 14:49:02 2003 +++ sys/net/bpf.c Thu Sep 4 17:24:18 2003 @@ -1140,11 +1140,6 @@ u_int pktlen, slen; pktlen = m_length(m, NULL); - if (pktlen == m->m_len) { - bpf_tap(bp, mtod(m, u_char *), pktlen); - return; - } - BPFIF_LOCK(bp); for (d = bp->bif_dlist; d != 0; d = d->bd_next) { if (!d->bd_seesent && (m->m_pkthdr.rcvif == NULL))