Ejemplo n.º 1
0
static void
gif_clone_destroy(struct ifnet *ifp)
{
	struct gif_softc *sc;

	sx_xlock(&gif_ioctl_sx);
	sc = ifp->if_softc;
	gif_delete_tunnel(sc);
	if (ng_gif_detach_p != NULL)
		(*ng_gif_detach_p)(ifp);
	bpfdetach(ifp);
	if_detach(ifp);
	ifp->if_softc = NULL;
	sx_xunlock(&gif_ioctl_sx);

	GIF_WAIT();
	if_free(ifp);
	free(sc, M_GIF);
}
Ejemplo n.º 2
0
static void
gif_clone_destroy(struct ifnet *ifp)
{
	struct gif_softc *sc;

	sx_xlock(&gif_ioctl_sx);
	sc = ifp->if_softc;
	gif_delete_tunnel(ifp);
	GIF_LIST_LOCK();
	LIST_REMOVE(sc, gif_list);
	GIF_LIST_UNLOCK();
	if (ng_gif_detach_p != NULL)
		(*ng_gif_detach_p)(ifp);
	bpfdetach(ifp);
	if_detach(ifp);
	ifp->if_softc = NULL;
	sx_xunlock(&gif_ioctl_sx);

	if_free(ifp);
	GIF_LOCK_DESTROY(sc);
	free(sc, M_GIF);
}
Ejemplo n.º 3
0
static int
gif_clone_destroy(struct ifnet *ifp)
{
	struct gif_softc *sc = (void *) ifp;

	gif_delete_tunnel(&sc->gif_if);
	LIST_REMOVE(sc, gif_list);
#ifdef INET6
	encap_detach(sc->encap_cookie6);
#endif
#ifdef INET
	encap_detach(sc->encap_cookie4);
#endif

	bpf_detach(ifp);
	if_detach(ifp);
	rtcache_free(&sc->gif_ro);

	free(sc, M_DEVBUF);

	return (0);
}