PERFORCE change 38151 for review
Sam Leffler
sam at FreeBSD.org
Tue Sep 16 15:33:02 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=38151
Change 38151 by sam at sam_ebb on 2003/09/16 15:32:18
cleanup module unload: must hold lock to call bridge_off;
remove bogus distinction between building as a module and
a static kernel component
Affected files ...
.. //depot/projects/netperf/sys/net/bridge.c#7 edit
Differences ...
==== //depot/projects/netperf/sys/net/bridge.c#7 (text+ko) ====
@@ -1213,7 +1213,6 @@
return 0 ;
}
-#ifdef KLD_MODULE
static void
bdgdestroy(void)
{
@@ -1222,17 +1221,15 @@
bdgtakeifaces_ptr = NULL;
callout_stop(&bdg_callout);
+ BDG_LOCK();
bridge_off();
- if (clusters)
- free(clusters, M_IFADDR);
if (ifp2sc) {
free(ifp2sc, M_IFADDR);
ifp2sc = NULL;
}
BDG_LOCK_DESTROY();
}
-#endif /* KLD_MODULE */
/*
* initialization code, both for static and dynamic loading.
@@ -1240,28 +1237,22 @@
static int
bridge_modevent(module_t mod, int type, void *unused)
{
- int err = 0 ;
+ int err;
switch (type) {
case MOD_LOAD:
- if (BDG_LOADED) {
+ if (BDG_LOADED)
err = EEXIST;
- break ;
- }
- err = bdginit();
+ else
+ err = bdginit();
break;
case MOD_UNLOAD:
-#if !defined(KLD_MODULE)
- printf("bridge statically compiled, cannot unload\n");
- err = EINVAL ;
-#else
- /* XXX lock */
do_bridge = 0;
bdgdestroy();
-#endif
+ err = 0;
break;
default:
- err = EINVAL ;
+ err = EINVAL;
break;
}
return err;
More information about the p4-projects
mailing list