summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-10-11 09:11:57 +0000
committerglebius <glebius@FreeBSD.org>2005-10-11 09:11:57 +0000
commitaf96d0663a5a01aa1e67fc0d3a54cba6f2f594b0 (patch)
treee0bdb82551e17b9572f64bb70e3ca525c1a4818d /sys
parent86f27343be799a56708bbc3c595fbefd7c274719 (diff)
downloadFreeBSD-src-af96d0663a5a01aa1e67fc0d3a54cba6f2f594b0.zip
FreeBSD-src-af96d0663a5a01aa1e67fc0d3a54cba6f2f594b0.tar.gz
Style and other fixes for the last commit.
Submitted by: ru
Diffstat (limited to 'sys')
-rw-r--r--sys/netgraph/ng_iface.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index d0d27c4..0cb2326 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -354,7 +354,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct rtentry *rt0)
{
uint32_t af;
- int error = 0;
+ int error;
/* Check interface flags */
if (!((ifp->if_flags & IFF_UP) &&
@@ -375,7 +375,9 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
M_PREPEND(m, sizeof(sa_family_t), M_DONTWAIT);
if (m == NULL) {
- ifp->if_iqdrops++;
+ IFQ_LOCK(&ifp->if_snd);
+ IFQ_INC_DROPS(&ifp->if_snd);
+ IFQ_UNLOCK(&ifp->if_snd);
ifp->if_oerrors++;
return (ENOBUFS);
}
@@ -388,7 +390,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
}
/*
- * Start method is used only when ALTQ is on.
+ * Start method is used only when ALTQ is enabled.
*/
static void
ng_iface_start(struct ifnet *ifp)
@@ -396,9 +398,9 @@ ng_iface_start(struct ifnet *ifp)
struct mbuf *m;
sa_family_t sa;
- KASSERT(ALTQ_IS_ENABLED(&ifp->if_snd),("ng_iface_start without ALTQ"));
+ KASSERT(ALTQ_IS_ENABLED(&ifp->if_snd), ("%s without ALTQ", __func__));
- while (1) {
+ for(;;) {
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
if (m == NULL)
break;
@@ -425,14 +427,14 @@ ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_family_t family)
/*
* This routine does actual delivery of the packet into the
* netgraph(4). It is called from ng_iface_start() and
- * nf_iface_output().
+ * ng_iface_output().
*/
static int
ng_iface_send(struct ifnet *ifp, struct mbuf *m, sa_family_t sa)
{
const priv_p priv = (priv_p) ifp->if_softc;
const iffam_p iffam = get_iffam_from_af(sa);
- int error = 0;
+ int error;
int len;
/* Check address family to determine hook (if known) */
OpenPOWER on IntegriCloud