From dima@satty.npi.msu.su  Thu Jun 15 20:38:45 1995
Received: from satty.npi.msu.su (satty.npi.msu.su [158.250.2.251])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id UAA09415
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 15 Jun 1995 20:38:38 -0700
Received: (from dima@localhost) by satty.npi.msu.su (8.6.11/8.6.9) id DAA19369; Fri, 16 Jun 1995 03:38:34 GMT
Message-Id: <199506160338.DAA19369@satty.npi.msu.su>
Date: Fri, 16 Jun 1995 03:38:34 GMT
From: Dmitry Khrustalev <dima@satty.npi.msu.su>
Reply-To: dima@bog.msu.su
To: FreeBSD-gnats-submit@freebsd.org
Subject:
X-Send-Pr-Version: 3.2

>Number:         522
>Category:       kern
>Synopsis:       closing bpf will panic system in bpf.c line 278
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 15 20:40:00 1995
>Closed-Date:    Mon Jul 31 03:41:15 PDT 1995
>Last-Modified:  Mon Jul 31 03:44:08 PDT 1995
>Originator:     Dmitry Khrustalev
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
Moscow State University
>Environment:

	

>Description:

	If interface goes down while bpf is listening on it in promiscuous
	mode, closing bpf will panic system in bpf.c line 278.
	panic: bpf: ifpromisc failed

>How-To-Repeat:

	Start tcpdump on ppp interface while pppd is running. Terminate
	pppd. Terminating tcpdump will result in panic.

>Fix:

This fix changes current bpf behavior, however current behavior has problems:
for example if transmitting a packet results in interface going up, how do
we capture this packet?
	
*** bpf.c.orig	Fri Jun 16 06:12:07 1995
--- bpf.c	Fri Jun 16 06:12:35 1995
***************
*** 1261,1272 ****
  	int pswitch;
  {
  	struct ifreq ifr;
- 	/*
- 	 * If the device is not configured up, we cannot put it in
- 	 * promiscuous mode.
- 	 */
- 	if ((ifp->if_flags & IFF_UP) == 0)
- 		return (ENETDOWN);
  
  	if (pswitch) {
  		if (ifp->if_pcount++ != 0)
--- 1261,1266 ----

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Mon Jul 31 03:41:15 PDT 1995 
State-Changed-Why:  
Fixed in v1.10 of bpf.c. 
Note that if the interface SIOCSIFFLAGS routine fails, bpf will still panic. 
>Unformatted:



