summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_disk.c16
-rw-r--r--sys/nfs/nfs_boot.c3
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index d0e30cfd706..afcda8e9bef 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.70 2008/03/30 20:24:32 miod Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.71 2008/03/31 22:27:41 deraadt Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -58,6 +58,11 @@
#include <sys/proc.h>
#include <uvm/uvm_extern.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
+
+#include <net/if.h>
+
#include <dev/rndvar.h>
#include <dev/cons.h>
@@ -1059,6 +1064,7 @@ setroot(struct device *bootdv, int part, int exitflags)
struct swdevt *swp;
struct device *rootdv, *dv;
dev_t nrootdev, nswapdev = NODEV, temp = NODEV;
+ struct ifnet *ifp = NULL;
char buf[128];
#if defined(NFSCLIENT)
extern char *nfsbootdevname;
@@ -1197,6 +1203,14 @@ gotswap:
rootdv = parsedisk(buf, strlen(buf), 0, &nrootdev);
}
+ if (rootdv && rootdv == bootdv && rootdv->dv_class == DV_IFNET)
+ ifp = ifunit(rootdv->dv_xname);
+ else if (bootdv && bootdv->dv_class == DV_IFNET)
+ ifp = ifunit(bootdv->dv_xname);
+
+ if (ifp)
+ if_addgroup(ifp, "netboot");
+
switch (rootdv->dv_class) {
#if defined(NFSCLIENT)
case DV_IFNET:
diff --git a/sys/nfs/nfs_boot.c b/sys/nfs/nfs_boot.c
index 62a7c5776be..f1a3c241673 100644
--- a/sys/nfs/nfs_boot.c
+++ b/sys/nfs/nfs_boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_boot.c,v 1.19 2008/03/19 05:47:47 deraadt Exp $ */
+/* $OpenBSD: nfs_boot.c,v 1.20 2008/03/31 22:27:43 deraadt Exp $ */
/* $NetBSD: nfs_boot.c,v 1.26 1996/05/07 02:51:25 thorpej Exp $ */
/*
@@ -154,7 +154,6 @@ nfs_boot_init(nd, procp)
bcopy(ifp->if_xname, ireq.ifr_name, IFNAMSIZ);
printf("nfs_boot: using interface %s, with revarp & bootparams\n",
ireq.ifr_name);
- if_addgroup(ifp, "netboot");
/*
* Bring up the interface.