summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbjc <bjc@openbsd.org>2001-04-10 12:27:54 +0000
committerbjc <bjc@openbsd.org>2001-04-10 12:27:54 +0000
commit13b0e96b2ca22b9e26a319236794e524f3170676 (patch)
treefa830f003aa698c1a00253b67b8bec2806d3a2ce
parentdebug cleanup (diff)
downloadwireguard-openbsd-13b0e96b2ca22b9e26a319236794e524f3170676.tar.xz
wireguard-openbsd-13b0e96b2ca22b9e26a319236794e524f3170676.zip
Decrement open_count in netclose(); this fixes the bug which caused
boot to halt on boot attempts after a failed network boot attempt. Also, prototype netmountroot() and return 0 in netclose().
-rw-r--r--sys/arch/vax/boot/boot/netio.c8
-rw-r--r--sys/arch/vax/stand/boot/netio.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/arch/vax/boot/boot/netio.c b/sys/arch/vax/boot/boot/netio.c
index bbc01d23acc..f458f57d710 100644
--- a/sys/arch/vax/boot/boot/netio.c
+++ b/sys/arch/vax/boot/boot/netio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netio.c,v 1.1 2000/04/27 02:26:25 bjc Exp $ */
+/* $OpenBSD: netio.c,v 1.2 2001/04/10 12:27:54 bjc Exp $ */
/* $NetBSD: netio.c,v 1.4 1999/06/30 18:38:03 ragge Exp $ */
/*-
@@ -111,6 +111,8 @@ int netio_ask = 0; /* default to bootparam, can override */
static char input_line[100];
+int netmountroot __P((struct open_file *, char *));
+
/*
* Called by devopen after it sets f->f_dev to our devsw entry.
* This opens the low-level device and sets f->f_devdata.
@@ -139,8 +141,10 @@ int
netclose(f)
struct open_file *f;
{
- netif_close(netdev_sock);
+ if(--open_count == 0)
+ netif_close(netdev_sock);
f->f_devdata = NULL;
+ return 0;
}
int
diff --git a/sys/arch/vax/stand/boot/netio.c b/sys/arch/vax/stand/boot/netio.c
index bbc01d23acc..f458f57d710 100644
--- a/sys/arch/vax/stand/boot/netio.c
+++ b/sys/arch/vax/stand/boot/netio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netio.c,v 1.1 2000/04/27 02:26:25 bjc Exp $ */
+/* $OpenBSD: netio.c,v 1.2 2001/04/10 12:27:54 bjc Exp $ */
/* $NetBSD: netio.c,v 1.4 1999/06/30 18:38:03 ragge Exp $ */
/*-
@@ -111,6 +111,8 @@ int netio_ask = 0; /* default to bootparam, can override */
static char input_line[100];
+int netmountroot __P((struct open_file *, char *));
+
/*
* Called by devopen after it sets f->f_dev to our devsw entry.
* This opens the low-level device and sets f->f_devdata.
@@ -139,8 +141,10 @@ int
netclose(f)
struct open_file *f;
{
- netif_close(netdev_sock);
+ if(--open_count == 0)
+ netif_close(netdev_sock);
f->f_devdata = NULL;
+ return 0;
}
int