HEADS UP - DEVFS ON MASTER

Alex ahornung at gmail.com
Wed Aug 5 04:22:25 PDT 2009


Hi,

about if_tap, it should in theory autoclone on opening /dev/tap and
using fdevname or fdevname_r to retrieve the name from the open
descriptor. It is untested, but the code is present and should work at
least as far as creating the clone device.

As for major/minor goes, major is set to 0 always and minor was the
way it used to be. Relevant line in devfs_vnops.c:
vap->va_rminor = DEVFS_NODE(ap->a_vp)->d_dev->si_uminor; (in getattr)

Sincerely,
Alex

2009/8/5 Simon 'corecode' Schubert <corecode at fs.ei.tum.de>:
> YONETANI Tomokazu wrote:
>>
>> diff --git a/sys/platform/vkernel/platform/init.c
>> b/sys/platform/vkernel/platform/init.c
>> index 2d3fd72..7caaf5b 100644
>> --- a/sys/platform/vkernel/platform/init.c
>> +++ b/sys/platform/vkernel/platform/init.c
>> @@ -955,9 +955,7 @@ netif_open_tap(const char *netif, int *tap_unit, int
>> s)
>>         */
>>        failed = 1;
>>        if (fstat(tap_fd, &st) == 0 && S_ISCHR(st.st_mode) &&
>> -           TAPDEV_MAJOR(st.st_rdev) == TAP_CDEV_MAJOR) {
>> -               *tap_unit = TAPDEV_MINOR(st.st_rdev);
>> -
>> +           sscanf(tap_dev, "/dev/tap%d", tap_unit) == 1) {
>>                /*
>>                 * Bring up the corresponding tap(4) interface
>>                 */
>
> That seems strange.  Shouldn't be tap be cloning, i.e. just open /dev/tap,
> and then use devname(fd) (to retrieve the ifname) or ioctl() (to set the
> ifname)?
>
> cheers
>  simon
>
> --
>  <3 the future  +++  RENT this banner advert  +++   ASCII Ribbon   /"\
>  rock the past  +++  space for low CHF NOW!1  +++     Campaign     \ /
> Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
> Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
>





More information about the Kernel mailing list