In r191367 the need for if_free_type() was removed and a new member

if_alloctype was used to store the origional interface type.  Take
advantage of this change by removing all existing uses of if_free_type()
in favor of if_free().

MFC after:	1 Month
This commit is contained in:
Brooks Davis 2011-11-11 22:57:52 +00:00
parent 14517324d0
commit 4b22573a89
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227459
7 changed files with 12 additions and 11 deletions

View File

@ -4945,7 +4945,9 @@ lmc_ifnet_detach(softc_t *sc)
/* Detach from the ifnet kernel interface. */
if_detach(sc->ifp);
# if (__FreeBSD_version >= 600000)
# if (defined(__FreeBSD__) && __FreeBSD_version >= 800082)
if_free(sc->ifp);
# elif (defined(__FreeBSD__) && __FreeBSD_version >= 600000)
if_free_type(sc->ifp, NSPPP ? IFT_PPP : IFT_OTHER);
# endif
}

View File

@ -676,7 +676,7 @@ bridge_clone_destroy(struct ifnet *ifp)
bstp_detach(&sc->sc_stp);
ether_ifdetach(ifp);
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
/* Tear down the routing table. */
bridge_rtable_fini(sc);

View File

@ -275,7 +275,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) {
sc->sc_proto = lagg_protos[i].ti_proto;
if ((error = lagg_protos[i].ti_attach(sc)) != 0) {
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
free(sc, M_DEVBUF);
return (error);
}
@ -293,7 +293,6 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
if_initname(ifp, ifc->ifc_name, unit);
ifp->if_type = IFT_ETHER;
ifp->if_softc = sc;
ifp->if_start = lagg_start;
ifp->if_init = lagg_init;
@ -305,7 +304,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
IFQ_SET_READY(&ifp->if_snd);
/*
* Attach as an ordinary ethernet device, childs will be attached
* Attach as an ordinary ethernet device, children will be attached
* as special device IFT_IEEE8023ADLAG.
*/
ether_ifattach(ifp, eaddr);
@ -352,7 +351,7 @@ lagg_clone_destroy(struct ifnet *ifp)
ifmedia_removeall(&sc->sc_media);
ether_ifdetach(ifp);
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
mtx_lock(&lagg_list_mtx);
SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries);

View File

@ -218,7 +218,7 @@ tap_destroy(struct tap_softc *tp)
knlist_destroy(&tp->tap_rsel.si_note);
destroy_dev(tp->tap_dev);
ether_ifdetach(ifp);
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
mtx_destroy(&tp->tap_mtx);
free(tp, M_TAP);

View File

@ -967,7 +967,7 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
*/
ether_ifdetach(ifp);
vlan_unconfig(ifp);
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
ifc_free_unit(ifc, unit);
free(ifv, M_VLAN);
@ -989,7 +989,7 @@ vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp)
ether_ifdetach(ifp); /* first, remove it from system-wide lists */
vlan_unconfig(ifp); /* now it can be unconfigured and freed */
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
free(ifv, M_VLAN);
ifc_free_unit(ifc, unit);

View File

@ -1332,7 +1332,7 @@ ng_fec_shutdown(node_p node)
}
ether_ifdetach(priv->ifp);
if_free_type(priv->ifp, IFT_ETHER);
if_free(priv->ifp);
ifmedia_removeall(&priv->ifmedia);
ng_fec_free_unit(priv->unit);
free(priv, M_NETGRAPH);

View File

@ -472,7 +472,7 @@ carp_clone_destroy(struct ifnet *ifp)
mtx_unlock(&carp_mtx);
bpfdetach(ifp);
if_detach(ifp);
if_free_type(ifp, IFT_ETHER);
if_free(ifp);
#ifdef INET
free(sc->sc_imo.imo_membership, M_CARP);
#endif