From leres@ee.lbl.gov  Mon Sep 13 18:41:35 2004
Return-Path: <leres@ee.lbl.gov>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5E40A16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Sep 2004 18:41:35 +0000 (GMT)
Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [131.243.1.81])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0C16943D53
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Sep 2004 18:41:35 +0000 (GMT)
	(envelope-from leres@ee.lbl.gov)
Received: from fun.ee.lbl.gov (localhost [127.0.0.1])
	by fun.ee.lbl.gov (8.13.1/8.13.1) with ESMTP id i8DIfYhE063644
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Sep 2004 11:41:34 -0700 (PDT)
Received: from fun.ee.lbl.gov (leres@localhost)
	by fun.ee.lbl.gov (8.13.1/8.13.1/Submit) with ESMTP id i8DIfYWe063641
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Sep 2004 11:41:34 -0700 (PDT)
Message-Id: <200409131841.i8DIfYWe063641@fun.ee.lbl.gov>
Date: Mon, 13 Sep 2004 11:41:34 -0700
From: Craig Leres <leres@ee.lbl.gov>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] MAKEDEV create n+1 bpf devices
X-Send-Pr-Version: 3.113

>Number:         71708
>Category:       kern
>Synopsis:       [MAKEDEV] [PATCH] MAKEDEV create n+1 bpf devices
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 13 18:50:26 GMT 2004
>Closed-Date:    Sun Jan 08 14:46:37 GMT 2006
>Last-Modified:  Sun Jan 08 14:46:37 GMT 2006
>Originator:     Craig Leres
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
>Description:
	MAKEDEV creates one more bpf device than requested.

	In addition, "all" creates bpf0 4 times, bpf1 3 times and
	bpf2 twice.

	"tun" and "tap" have similar problems.

>How-To-Repeat:
	mkdir /tmp/dev
	cd /tmp/dev
	/dev/MAKEDEV bpf2
	ls
	(note three bpf's: bpf0, bpf1 and bpf2)

>Fix:
	See the appended context diff.

	(Note that now "./MAKEDEV bpf0" creates no devices.)

==============================================================================
*** MAKEDEV.virgin	Mon Sep 13 11:25:49 2004
--- MAKEDEV	Mon Sep 13 11:32:11 2004
***************
*** 336,344 ****
  	sh MAKEDEV smb0 smb1				# cdev, SMBus device
  	sh MAKEDEV usb usb0 uhid0 ums0 ulpt0 ugen0	# cdev, USB devices
  	sh MAKEDEV urio0 uscanner0 ucom0		# cdev, USB devices too
! 	sh MAKEDEV bpf0 bpf1 bpf2 bpf3 			# cdev, network
! 	sh MAKEDEV ipl tun0 tun1 tun2 tun3		# cdev, network
! 	sh MAKEDEV tap0 tap1 tap2 tap3			# cdev, network
  	sh MAKEDEV ch0 perfmon tw0			# cdev, miscellaneous
  	sh MAKEDEV apm apmctl card0 card1 card2 card3	# cdev, laptop
  	sh MAKEDEV pass4 xpt2				# cdev, CAM
--- 336,344 ----
  	sh MAKEDEV smb0 smb1				# cdev, SMBus device
  	sh MAKEDEV usb usb0 uhid0 ums0 ulpt0 ugen0	# cdev, USB devices
  	sh MAKEDEV urio0 uscanner0 ucom0		# cdev, USB devices too
! 	sh MAKEDEV bpf4 				# cdev, network
! 	sh MAKEDEV ipl tun4				# cdev, network
! 	sh MAKEDEV tap4					# cdev, network
  	sh MAKEDEV ch0 perfmon tw0			# cdev, miscellaneous
  	sh MAKEDEV apm apmctl card0 card1 card2 card3	# cdev, laptop
  	sh MAKEDEV pass4 xpt2				# cdev, CAM
***************
*** 1132,1138 ****
  bpf*)
  	nbpf=`expr $i : 'bpf\(.*\)$'`
  	unit=0
! 	while [ $unit -le $nbpf ]; do
  		mknod bpf$unit c 23 `unit2minor $unit`
  		unit=$(($unit + 1))
  	done
--- 1132,1138 ----
  bpf*)
  	nbpf=`expr $i : 'bpf\(.*\)$'`
  	unit=0
! 	while [ $unit -lt $nbpf ]; do
  		mknod bpf$unit c 23 `unit2minor $unit`
  		unit=$(($unit + 1))
  	done
***************
*** 1740,1746 ****
  tun*)
  	ntun=`expr $i : 'tun\(.*\)$'`
  	unit=0
! 	while [ $unit -le $ntun ]; do
  		mknod tun$unit c 52 `unit2minor $unit`
  		unit=$(($unit + 1))
  	done
--- 1740,1746 ----
  tun*)
  	ntun=`expr $i : 'tun\(.*\)$'`
  	unit=0
! 	while [ $unit -lt $ntun ]; do
  		mknod tun$unit c 52 `unit2minor $unit`
  		unit=$(($unit + 1))
  	done
***************
*** 1749,1755 ****
  tap*)
  	ntap=`expr $i : 'tap\(.*\)$'`
  	unit=0
! 	while [ $unit -le $ntap ]; do
  		mknod tap$unit c 149 `unit2minor $unit` root:network
  		unit=$(($unit + 1))
  	done
--- 1749,1755 ----
  tap*)
  	ntap=`expr $i : 'tap\(.*\)$'`
  	unit=0
! 	while [ $unit -lt $ntap ]; do
  		mknod tap$unit c 149 `unit2minor $unit` root:network
  		unit=$(($unit + 1))
  	done
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Sep 16 03:49:32 GMT 2004 
Responsible-Changed-Why:  
This is not i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71708 
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Mon Oct 24 02:03:31 GMT 2005 
State-Changed-Why:  
MAKEDEV now only exists on 4.X.  It is unlikely that anyone will be 
maintaining it further; however, leave this as 'suspended' in case there 
is some interest. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71708 
State-Changed-From-To: suspended->closed 
State-Changed-By: netchild 
State-Changed-When: Sun Jan 8 14:41:52 UTC 2006 
State-Changed-Why:  
All supported -stable and development branches use devfs now. So close 
this PR since it doesn't apply anymore and interested parties can have 
a look at closed PR's too. Closing this PR results in less PR's to look 
at when a committer is in a "lets fix a PR"-mood. 

Additionally, this isn't a problem. It may be an annoyance, but it 
doesn't justifies a PR someone has to look at periodically. 

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