summaryrefslogtreecommitdiffstats
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-06-29 13:17:01 +0000
committered <ed@FreeBSD.org>2008-06-29 13:17:01 +0000
commit67ff1e3090142c9dccc3139d6839a78d9324d96f (patch)
treefd7e38b305ba6f20a781c399c220d213cc0c331a /sys/net/if_loop.c
parent0eb008c7679de964c52b4613ad415b355443fa67 (diff)
downloadFreeBSD-src-67ff1e3090142c9dccc3139d6839a78d9324d96f.zip
FreeBSD-src-67ff1e3090142c9dccc3139d6839a78d9324d96f.tar.gz
Remove the unused softc from the lo(4) driver.
Now that the pseudo-interface cloner has an internal list of instances, there is no need to create a softc. The softc only contains a pointer to the ifp, which means there is no valid reason to keep it. While there, remove the corresponding malloc-pool. Approved by: philip (mentor)
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 5665d65..70611a8 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -42,7 +42,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <machine/bus.h>
@@ -89,12 +88,6 @@
#define LOMTU 16384
#endif
-#define LONAME "lo"
-
-struct lo_softc {
- struct ifnet *sc_ifp;
-};
-
int loioctl(struct ifnet *, u_long, caddr_t);
static void lortrequest(int, struct rtentry *, struct rt_addrinfo *);
int looutput(struct ifnet *ifp, struct mbuf *m,
@@ -104,16 +97,11 @@ static void lo_clone_destroy(struct ifnet *);
struct ifnet *loif = NULL; /* Used externally */
-static MALLOC_DEFINE(M_LO, LONAME, "Loopback Interface");
-
IFC_SIMPLE_DECLARE(lo, 1);
static void
lo_clone_destroy(struct ifnet *ifp)
{
- struct lo_softc *sc;
-
- sc = ifp->if_softc;
/* XXX: destroying lo0 will lead to panics. */
KASSERT(loif != ifp, ("%s: destroying lo0", __func__));
@@ -121,21 +109,16 @@ lo_clone_destroy(struct ifnet *ifp)
bpfdetach(ifp);
if_detach(ifp);
if_free(ifp);
- free(sc, M_LO);
}
static int
lo_clone_create(struct if_clone *ifc, int unit, caddr_t params)
{
struct ifnet *ifp;
- struct lo_softc *sc;
- MALLOC(sc, struct lo_softc *, sizeof(*sc), M_LO, M_WAITOK | M_ZERO);
- ifp = sc->sc_ifp = if_alloc(IFT_LOOP);
- if (ifp == NULL) {
- free(sc, M_LO);
+ ifp = if_alloc(IFT_LOOP);
+ if (ifp == NULL)
return (ENOSPC);
- }
if_initname(ifp, ifc->ifc_name, unit);
ifp->if_mtu = LOMTU;
@@ -143,7 +126,6 @@ lo_clone_create(struct if_clone *ifc, int unit, caddr_t params)
ifp->if_ioctl = loioctl;
ifp->if_output = looutput;
ifp->if_snd.ifq_maxlen = ifqmaxlen;
- ifp->if_softc = sc;
if_attach(ifp);
bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
if (loif == NULL)
OpenPOWER on IntegriCloud