From owner-freebsd-bugs Mon Sep 18 22:50: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0293137B424 for ; Mon, 18 Sep 2000 22:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA31626; Mon, 18 Sep 2000 22:50:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from ego.mind.net (ego.mind.net [206.99.66.9]) by hub.freebsd.org (Postfix) with ESMTP id 5801B37B43C for ; Mon, 18 Sep 2000 22:41:55 -0700 (PDT) Received: from takhus-home.ashlandfn.org (AFN-Dyn-6315110844.pc.ashlandfiber.net [63.151.108.44]) by ego.mind.net (8.9.3/8.9.3) with ESMTP id WAA09647 for ; Mon, 18 Sep 2000 22:41:51 -0700 Received: from localhost (fleisher@localhost) by takhus-home.ashlandfn.org (8.11.0/8.11.0) with ESMTP id e8J5foD00739 for ; Mon, 18 Sep 2000 22:41:50 -0700 (PDT) (envelope-from takhus@takhus.mind.net) Message-Id: Date: Mon, 18 Sep 2000 22:41:50 -0700 (PDT) From: Tony Fleisher To: FreeBSD-gnats-submit@freebsd.org Subject: kern/21391: WARNING: Driver mistake: repeat make_dev("bpf0") Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 >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