Re: HEADS UP - DEVFS ON MASTER

看板DFBSD_kernel作者時間16年前 (2009/08/05 19:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/8 (看更多)
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 / \
文章代碼(AID): #1AUMPqTE (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #1AUMPqTE (DFBSD_kernel)