Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

netgraph: do not unconditionally load ng_ksocket module

Unconditionally loading ng_ksocket module was preventing correct operation
when compiling netgraph into the kernel (i.e. when not compiled as a
module).
  • Loading branch information...
commit 8d7fe9c29c4d87f864b3f9cbe84b76e2fc1e44d8 1 parent 007d685
@ntunes ntunes authored
Showing with 0 additions and 30 deletions.
  1. +0 −30 sys/netgraph/netgraph/ng_base.c
View
30 sys/netgraph/netgraph/ng_base.c
@@ -94,7 +94,6 @@ static ng_ID_t ng_decodeidname(const char *name);
static int ngb_mod_event(module_t mod, int event, void *data);
static void ngintr(union netmsg *);
static int ng_load_module(const char *);
-static int ng_unload_module(const char *);
/* Our own netgraph malloc type */
MALLOC_DEFINE(M_NETGRAPH, "netgraph", "netgraph structures and ctrl messages");
@@ -345,28 +344,6 @@ ng_load_module(const char *name)
return (error);
}
-static int
-ng_unload_module(const char *name)
-{
- char filename[NG_TYPESIZ + 3];
- linker_file_t lf;
- int error;
-
- if (!linker_api_available())
- return (ENXIO);
-
- /* Not found, try to load it as a loadable module */
- ksnprintf(filename, sizeof(filename), "ng_%s.ko", name);
- if ((lf = linker_find_file_by_name(filename)) == NULL)
- return (ENXIO);
- lf->userrefs--; /* pretend kldunload'ed */
- error = linker_file_unload(lf);
- if (error)
- lf->userrefs++;
-
- return (error);
-}
-
/*
* Instantiate a node of the requested type
*/
@@ -1839,17 +1816,10 @@ ngb_mod_event(module_t mod, int event, void *data)
case MOD_LOAD:
/* Register line discipline */
crit_enter();
- error = ng_load_module("ksocket");
- if (error != 0) {
- crit_exit();
- break;
- }
netisr_register(NETISR_NETGRAPH, ngintr, NULL);
- error = 0;
crit_exit();
break;
case MOD_UNLOAD:
- ng_unload_module("ksocket");
/* You cant unload it because an interface may be using it. */
error = EBUSY;
break;
Please sign in to comment.
Something went wrong with that request. Please try again.