i386/71708: [PATCH] MAKEDEV create n+1 bpf devices
Craig Leres
leres at ee.lbl.gov
Mon Sep 13 11:50:27 PDT 2004
>Number: 71708
>Category: i386
>Synopsis: [PATCH] MAKEDEV create n+1 bpf devices
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-i386
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Sep 13 18:50:26 GMT 2004
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
More information about the freebsd-i386
mailing list