From vys@fox.renet.ru  Thu Sep  4 07:25:46 2003
Return-Path: <vys@fox.renet.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 078EB16A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Sep 2003 07:25:46 -0700 (PDT)
Received: from fox.renet.ru (net-33.renet.ru [195.161.130.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8DE8743FBF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Sep 2003 07:25:44 -0700 (PDT)
	(envelope-from vys@fox.renet.ru)
Received: from fox.renet.ru (localhost [127.0.0.1])
	by fox.renet.ru (8.12.9/8.12.9) with ESMTP id h84EPgGg024651;
	Thu, 4 Sep 2003 18:25:42 +0400 (MSD)
	(envelope-from vys@fox.renet.ru)
Received: (from root@localhost)
	by fox.renet.ru (8.12.9/8.12.9/Submit) id h84EPbGE024650;
	Thu, 4 Sep 2003 18:25:37 +0400 (MSD)
	(envelope-from vys)
Message-Id: <200309041425.h84EPbGE024650@fox.renet.ru>
Date: Thu, 4 Sep 2003 18:25:37 +0400 (MSD)
From: "Vladimir Yu. Stepanov" <vys@renet.ru>
Reply-To: "Vladimir Yu. Stepanov" <vys@renet.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: vys@renet.ru
Subject:
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56441
>Category:       kern
>Synopsis:       bpf_tap() used incorrectly in bpf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    andre
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 04 07:30:20 PDT 2003
>Closed-Date:    Mon Sep 26 14:22:09 GMT 2005
>Last-Modified:  Mon Sep 26 14:22:09 GMT 2005
>Originator:     RENET COM
>Release:        FreeBSD 5.0-RELEASE i386
>Organization:
>Environment:
 System: FreeBSD fox.renet.ru 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Sun Aug 31 13:33:55 MSD 2003 root@fox.renet.ru:/usr/src/sys/i386/compile/FOX i386
 
>Description:
 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))
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: ceri 
Responsible-Changed-When: Thu Sep 4 11:02:38 PDT 2003 
Responsible-Changed-Why:  
Reassign misfiled PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56441 
Responsible-Changed-From-To: freebsd-bugs->andre 
Responsible-Changed-By: andre 
Responsible-Changed-When: Sat Dec 27 09:12:07 PST 2003 
Responsible-Changed-Why:  
Take over. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56441 
State-Changed-From-To: open->patched 
State-Changed-By: andre 
State-Changed-When: Wed Sep 14 16:37:43 GMT 2005 
State-Changed-Why:  
Patch committed in sys/net/bpf.c rev. 1.160.  MFC pending. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56441 
State-Changed-From-To: patched->closed 
State-Changed-By: andre 
State-Changed-When: Mon Sep 26 14:21:40 GMT 2005 
State-Changed-Why:  
MFC to RELENG_6 and RELENG_5 done. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56441 
>Unformatted:
