summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 2679be3..2881612 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -554,6 +554,7 @@ if_alloc(u_char type)
#ifdef MAC
mac_ifnet_init(ifp);
#endif
+ ifq_init(&ifp->if_snd, ifp);
refcount_init(&ifp->if_refcount, 1); /* Index reference. */
IFNET_WLOCK();
@@ -596,7 +597,7 @@ if_free_internal(struct ifnet *ifp)
knlist_destroy(&ifp->if_klist);
IF_AFDATA_DESTROY(ifp);
IF_ADDR_LOCK_DESTROY(ifp);
- ifq_detach(&ifp->if_snd);
+ ifq_delete(&ifp->if_snd);
free(ifp, M_IFNET);
}
@@ -655,7 +656,7 @@ if_rele(struct ifnet *ifp)
}
void
-ifq_attach(struct ifaltq *ifq, struct ifnet *ifp)
+ifq_init(struct ifaltq *ifq, struct ifnet *ifp)
{
mtx_init(&ifq->ifq_mtx, ifp->if_xname, "if send queue", MTX_DEF);
@@ -671,7 +672,7 @@ ifq_attach(struct ifaltq *ifq, struct ifnet *ifp)
}
void
-ifq_detach(struct ifaltq *ifq)
+ifq_delete(struct ifaltq *ifq)
{
mtx_destroy(&ifq->ifq_mtx);
}
@@ -742,8 +743,6 @@ if_attach_internal(struct ifnet *ifp, int vmove)
net_cdevsw.d_name, ifp->if_index);
}
- ifq_attach(&ifp->if_snd, ifp);
-
/*
* Create a Link Level name for this device.
*/
OpenPOWER on IntegriCloud