Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2000 22:41:50 -0700 (PDT)
From:      Tony Fleisher <takhus@takhus.mind.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/21391: WARNING: Driver mistake: repeat make_dev("bpf0")
Message-ID:  <Pine.BSF.4.21.0009182238570.727-100000@takhus-home.ashlandfn.org>

next in thread | raw e-mail | index | archive | help

>Number:         21391
>Category:       kern
>Synopsis:       WARNING messages occur when bpf is used with DEVFS in -current
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 18 22:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Tony Fleisher <takhus@takhus.mind.net>
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
	
FreeBSD 5.0-CURRENT #2: Mon Sep 18 21:41:42 PDT 2000

>Description:
	
The following error repeatedly occurrs under -current anytime a 
program opened the bpf device:
          
WARNING: Driver mistake: repeat make_dev("bpf0")

The problem seems to be caused by make_dev being called in both bpf_clone()
and bpfopen() in sys/net/bpf.c


>How-To-Repeat:
	
	Compile a kernel under -current with bpf and DEVFS.
	Use any program (such as tcpdump or dhclient) that uses bpf.

>Fix:
	
The errors went away when I applied the patch attached below. I
am not sure if this is the correct solution, but it does solve
the problem.


*** sys/net/bpf.c.ORIG	Mon Sep 18 21:14:02 2000
--- sys/net/bpf.c	Mon Sep 18 21:46:50 2000
***************
*** 363,369 ****
--- 363,374 ----
  	 */
  	if (d)
  		return (EBUSY);
+ 	/*
+ 	 * No need for make_dev here, as we make_dev() in bpf_clone()
+ 	 */
+ 	/*
  	make_dev(&bpf_cdevsw, minor(dev), 0, 0, 0600, "bpf%d", lminor(dev));
+ 	*/
  	MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK);
  	bzero(d, sizeof(*d));
  	dev->si_drv1 = d;




>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0009182238570.727-100000>