Date: Wed, 31 Aug 2005 15:59:45 -0400 From: Ed Maste <emaste@phaedrus.sandvine.ca> To: freebsd-net@freebsd.org Subject: BIOCSSEESENT ioctl not honoured for single-mbuf packets Message-ID: <20050831195945.GA22805@sandvine.com>
next in thread | raw e-mail | index | archive | help
A coworker of mine discovered a bug in bpf with BIOCSEESENT. In sys/net/bpf.c, bpf_mtap() does if (pktlen == m->m_len) { bpf_tap(bp, mtod(m, u_char *), pktlen); return; } BPFIF_LOCK(bp); LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (!d->bd_seesent && (m->m_pkthdr.rcvif == NULL)) continue; [...] The pktlen == m->m_len is an optimization for the case where the entire packet is in a single mbuf, added in version 1.95. However, bd_seesent then isn't checked so all packets will be seen. In order to make bpf_tap work correctly with BIOCSEESENT for both this case and the few drivers that use it, I think it needs another argument to indicate if the packet is being sent or not. Is it possible to change the API for bpf_tap? Or add a bpf_tap2 that includes the flag, and make bpf_tap call it (for any third party drivers using bpf_tap)? -- Ed Maste Sandvine Incorporated
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050831195945.GA22805>