Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/ipf/netinet Another case of not calling dev...
details: https://anonhg.NetBSD.org/src/rev/b68ada6ddae9
branches: trunk
changeset: 346523:b68ada6ddae9
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Jul 17 02:02:01 2016 +0000
description:
Another case of not calling devsw_attach() for built-in device modules
diffstat:
sys/external/bsd/ipf/netinet/ip_fil_netbsd.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (65 lines):
diff -r 21617d8aadaa -r b68ada6ddae9 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c Sun Jul 17 01:16:30 2016 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c Sun Jul 17 02:02:01 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_fil_netbsd.c,v 1.16 2016/07/07 09:32:02 ozaki-r Exp $ */
+/* $NetBSD: ip_fil_netbsd.c,v 1.17 2016/07/17 02:02:01 pgoyette Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.16 2016/07/07 09:32:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.17 2016/07/17 02:02:01 pgoyette Exp $");
#else
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -2162,7 +2162,9 @@
static int ipl_fini(void *);
static int ipl_modcmd(modcmd_t, void *);
+#ifdef _MODULE
static devmajor_t ipl_cmaj = -1, ipl_bmaj = -1;
+#endif
static int
ipl_modcmd(modcmd_t cmd, void *opaque)
@@ -2198,6 +2200,7 @@
mutex_init(&ipf_ref_mutex, MUTEX_DEFAULT, IPL_NONE);
ipf_active = 0;
+#ifdef _MODULE
/*
* Insert ourself into the cdevsw list. It's OK if we are
* already there, since this will happen when our module is
@@ -2209,6 +2212,7 @@
error = devsw_attach("ipl", NULL, &ipl_bmaj, &ipl_cdevsw, &ipl_cmaj);
if (error == EEXIST)
error = 0;
+#endif
if (error)
ipl_fini(opaque);
@@ -2220,7 +2224,9 @@
ipl_fini(void *opaque)
{
+#ifdef _MODULE
(void)devsw_detach(NULL, &ipl_cdevsw);
+#endif
/*
* Grab the mutex, verify that there are no references
@@ -2230,8 +2236,10 @@
*/
mutex_enter(&ipf_ref_mutex);
if (ipf_active != 0 || ipfmain.ipf_running > 0) {
+#ifdef _MODULE
(void)devsw_attach("ipl", NULL, &ipl_bmaj,
&ipl_cdevsw, &ipl_cmaj);
+#endif
mutex_exit(&ipf_ref_mutex);
return EBUSY;
}
Home |
Main Index |
Thread Index |
Old Index