summaryrefslogtreecommitdiffstats
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2007-10-27 18:25:53 +0000
committeryar <yar@FreeBSD.org>2007-10-27 18:25:53 +0000
commit31933d86154d26e5846f250604cfe53be8622bce (patch)
tree2770b474138efafab3bf162feacff1c59531f38c /sys/net/if_loop.c
parentbd7f6192a0dc70368c0b02698dd8f912476c83fa (diff)
downloadFreeBSD-src-31933d86154d26e5846f250604cfe53be8622bce.zip
FreeBSD-src-31933d86154d26e5846f250604cfe53be8622bce.tar.gz
if_loop doesn't need to keep the list of lo(4) interfaces. Today
a private softc list is needed neither for tracking clones in general nor for destroying all clones before the module unload -- if_clone takes care of all that. (Note that some other interface drivers do need a softc list to be able to scan it for their private purposes.)
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index a1bfc7b..65b3d7b 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -94,7 +94,6 @@
struct lo_softc {
struct ifnet *sc_ifp;
- LIST_ENTRY(lo_softc) sc_next;
};
int loioctl(struct ifnet *, u_long, caddr_t);
@@ -108,9 +107,6 @@ struct ifnet *loif = NULL; /* Used externally */
static MALLOC_DEFINE(M_LO, LONAME, "Loopback Interface");
-static struct mtx lo_mtx;
-static LIST_HEAD(lo_list, lo_softc) lo_list;
-
IFC_SIMPLE_DECLARE(lo, 1);
static void
@@ -124,9 +120,6 @@ lo_clone_destroy(ifp)
/* XXX: destroying lo0 will lead to panics. */
KASSERT(loif != ifp, ("%s: destroying lo0", __func__));
- mtx_lock(&lo_mtx);
- LIST_REMOVE(sc, sc_next);
- mtx_unlock(&lo_mtx);
bpfdetach(ifp);
if_detach(ifp);
if_free(ifp);
@@ -158,9 +151,6 @@ lo_clone_create(ifc, unit, params)
ifp->if_softc = sc;
if_attach(ifp);
bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
- mtx_lock(&lo_mtx);
- LIST_INSERT_HEAD(&lo_list, sc, sc_next);
- mtx_unlock(&lo_mtx);
if (loif == NULL)
loif = ifp;
@@ -172,8 +162,6 @@ loop_modevent(module_t mod, int type, void *data)
{
switch (type) {
case MOD_LOAD:
- mtx_init(&lo_mtx, "lo_mtx", NULL, MTX_DEF);
- LIST_INIT(&lo_list);
if_clone_attach(&lo_cloner);
break;
case MOD_UNLOAD:
OpenPOWER on IntegriCloud