kern/subr_disk.c: convert ifunit() to if_unit(9)
authormvs <mvs@openbsd.org>
Tue, 19 Jan 2021 19:36:48 +0000 (19:36 +0000)
committermvs <mvs@openbsd.org>
Tue, 19 Jan 2021 19:36:48 +0000 (19:36 +0000)
ok dlg@

sys/kern/subr_disk.c

index e73d509..7125e3f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: subr_disk.c,v 1.237 2020/05/29 04:42:25 deraadt Exp $ */
+/*     $OpenBSD: subr_disk.c,v 1.238 2021/01/19 19:36:48 mvs Exp $     */
 /*     $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $  */
 
 /*
@@ -1610,10 +1610,12 @@ gotswap:
        }
 
        if (bootdv != NULL && bootdv->dv_class == DV_IFNET)
-               ifp = ifunit(bootdv->dv_xname);
+               ifp = if_unit(bootdv->dv_xname);
 
-       if (ifp)
+       if (ifp) {
                if_addgroup(ifp, "netboot");
+               if_put(ifp);
+       }
 
        switch (rootdv->dv_class) {
 #if defined(NFSCLIENT)