Re: HEADS UP - DEVFS ON MASTER

看板DFBSD_kernel作者時間16年前 (2009/08/05 19:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/8 (看更多)
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 =3D DEVFS_NODE(ap->a_vp)->d_dev->si_uminor; (in getattr) Sincerely, Alex 2009/8/5 Simon 'corecode' Schubert <corecode@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) >> =A0 =A0 =A0 =A0 */ >> =A0 =A0 =A0 =A0failed =3D 1; >> =A0 =A0 =A0 =A0if (fstat(tap_fd, &st) =3D=3D 0 && S_ISCHR(st.st_mode) && >> - =A0 =A0 =A0 =A0 =A0 TAPDEV_MAJOR(st.st_rdev) =3D=3D TAP_CDEV_MAJOR) { >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 *tap_unit =3D TAPDEV_MINOR(st.st_rdev); >> - >> + =A0 =A0 =A0 =A0 =A0 sscanf(tap_dev, "/dev/tap%d", tap_unit) =3D=3D 1) = { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * Bring up the corresponding tap(4) inte= rface >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > > That seems strange. =A0Shouldn't be tap be cloning, i.e. just open /dev/t= ap, > and then use devname(fd) (to retrieve the ifname) or ioctl() (to set the > ifname)? > > cheers > =A0simon > > -- > =A0<3 the future =A0+++ =A0RENT this banner advert =A0+++ =A0 ASCII Ribbo= n =A0 /"\ > =A0rock the past =A0+++ =A0space for low CHF NOW!1 =A0+++ =A0 =A0 Campaig= n =A0 =A0 \ / > Party Enjoy Relax =A0 | =A0 http://dragonflybsd.org =A0 =A0 =A0Against = =A0HTML =A0 \ > Dude 2c 2 the max =A0 ! =A0 http://golden-apple.biz =A0 =A0 =A0 Mail + Ne= ws =A0 / \ >
文章代碼(AID): #1AUMsu-i (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #1AUMsu-i (DFBSD_kernel)