diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 284874969e2a..5d7ce75e02da 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -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); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index feef9c9e9344..c804ad3894f9 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -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); }