Pass the minor number rather than the unit number to make_dev()

from the clone handler.
This commit is contained in:
Brian Somers 2001-02-02 03:32:25 +00:00
parent 115867175a
commit d38cfdcb8c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71921
2 changed files with 3 additions and 4 deletions

View File

@ -221,10 +221,10 @@ tapclone(arg, name, namelen, dev)
if (dev_stdclone(name, NULL, device_name, &unit) != 1)
return;
minor = (unit | VMNET_DEV_MASK);
minor = unit2minor(unit | VMNET_DEV_MASK);
}
else
minor = unit;
minor = unit2minor(unit);
*dev = make_dev(&tap_cdevsw, minor, UID_ROOT, GID_WHEEL, 0600, "%s%d",
device_name, unit);

View File

@ -105,8 +105,7 @@ tun_clone(arg, name, namelen, dev)
return;
if (dev_stdclone(name, NULL, "tun", &u) != 1)
return;
/* XXX: minor encoding if u > 255 */
*dev = make_dev(&tun_cdevsw, u,
*dev = make_dev(&tun_cdevsw, unit2minor(u),
UID_UUCP, GID_DIALER, 0600, "tun%d", u);
}