Mechanically convert to if_inc_counter().
This commit is contained in:
parent
a001989d9b
commit
3751dddb3e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271867
@ -357,7 +357,7 @@ arc_defrag(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if (m->m_len < ARC_HDRNEWLEN) {
|
if (m->m_len < ARC_HDRNEWLEN) {
|
||||||
m = m_pullup(m, ARC_HDRNEWLEN);
|
m = m_pullup(m, ARC_HDRNEWLEN);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -377,7 +377,7 @@ arc_defrag(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if (m->m_len < ARC_HDRNEWLEN) {
|
if (m->m_len < ARC_HDRNEWLEN) {
|
||||||
m = m_pullup(m, ARC_HDRNEWLEN);
|
m = m_pullup(m, ARC_HDRNEWLEN);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -530,11 +530,11 @@ arc_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
|
|
||||||
if (ah->arc_dhost == arcbroadcastaddr) {
|
if (ah->arc_dhost == arcbroadcastaddr) {
|
||||||
m->m_flags |= M_BCAST|M_MCAST;
|
m->m_flags |= M_BCAST|M_MCAST;
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
atype = ah->arc_type;
|
atype = ah->arc_type;
|
||||||
|
@ -252,7 +252,7 @@ atm_input(struct ifnet *ifp, struct atm_pseudohdr *ah, struct mbuf *m,
|
|||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
mac_ifnet_create_mbuf(ifp, m);
|
mac_ifnet_create_mbuf(ifp, m);
|
||||||
#endif
|
#endif
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
|
|
||||||
if (ng_atm_input_p != NULL) {
|
if (ng_atm_input_p != NULL) {
|
||||||
(*ng_atm_input_p)(ifp, &m, ah, rxhand);
|
(*ng_atm_input_p)(ifp, &m, ah, rxhand);
|
||||||
|
@ -1848,7 +1848,7 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m)
|
|||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
if_printf(dst_ifp,
|
if_printf(dst_ifp,
|
||||||
"unable to prepend VLAN header\n");
|
"unable to prepend VLAN header\n");
|
||||||
dst_ifp->if_oerrors++;
|
if_inc_counter(dst_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m->m_flags &= ~M_VLANTAG;
|
m->m_flags &= ~M_VLANTAG;
|
||||||
@ -1856,14 +1856,14 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m)
|
|||||||
|
|
||||||
if ((err = dst_ifp->if_transmit(dst_ifp, m))) {
|
if ((err = dst_ifp->if_transmit(dst_ifp, m))) {
|
||||||
m_freem(m0);
|
m_freem(m0);
|
||||||
sc->sc_ifp->if_oerrors++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->sc_ifp->if_opackets++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
sc->sc_ifp->if_obytes += len;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OBYTES, len);
|
||||||
if (mflags & M_MCAST)
|
if (mflags & M_MCAST)
|
||||||
sc->sc_ifp->if_omcasts++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OMCASTS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (err);
|
return (err);
|
||||||
@ -1994,7 +1994,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
|
|||||||
} else {
|
} else {
|
||||||
mc = m_copypacket(m, M_NOWAIT);
|
mc = m_copypacket(m, M_NOWAIT);
|
||||||
if (mc == NULL) {
|
if (mc == NULL) {
|
||||||
sc->sc_ifp->if_oerrors++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2084,8 +2084,8 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif,
|
|||||||
src_if = m->m_pkthdr.rcvif;
|
src_if = m->m_pkthdr.rcvif;
|
||||||
ifp = sc->sc_ifp;
|
ifp = sc->sc_ifp;
|
||||||
|
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
vlan = VLANTAGOF(m);
|
vlan = VLANTAGOF(m);
|
||||||
|
|
||||||
if ((sbif->bif_flags & IFBIF_STP) &&
|
if ((sbif->bif_flags & IFBIF_STP) &&
|
||||||
@ -2137,7 +2137,7 @@ bridge_forward(struct bridge_softc *sc, struct bridge_iflist *sbif,
|
|||||||
goto drop;
|
goto drop;
|
||||||
|
|
||||||
/* ...forward it to all interfaces. */
|
/* ...forward it to all interfaces. */
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
dst_if = NULL;
|
dst_if = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2245,8 +2245,8 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if ((bifp->if_flags & IFF_MONITOR) != 0) {
|
if ((bifp->if_flags & IFF_MONITOR) != 0) {
|
||||||
m->m_pkthdr.rcvif = bifp;
|
m->m_pkthdr.rcvif = bifp;
|
||||||
ETHER_BPF_MTAP(bifp, m);
|
ETHER_BPF_MTAP(bifp, m);
|
||||||
bifp->if_ipackets++;
|
if_inc_counter(bifp, IFCOUNTER_IPACKETS, 1);
|
||||||
bifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(bifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -2347,8 +2347,8 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
) { \
|
) { \
|
||||||
if ((iface)->if_type == IFT_BRIDGE) { \
|
if ((iface)->if_type == IFT_BRIDGE) { \
|
||||||
ETHER_BPF_MTAP(iface, m); \
|
ETHER_BPF_MTAP(iface, m); \
|
||||||
iface->if_ipackets++; \
|
if_inc_counter(iface, IFCOUNTER_IPACKETS, 1); \
|
||||||
iface->if_ibytes += m->m_pkthdr.len; \
|
if_inc_counter(iface, IFCOUNTER_IBYTES, m->m_pkthdr.len); \
|
||||||
/* Filter on the physical interface. */ \
|
/* Filter on the physical interface. */ \
|
||||||
if (pfil_local_phys && \
|
if (pfil_local_phys && \
|
||||||
(PFIL_HOOKED(&V_inet_pfil_hook) \
|
(PFIL_HOOKED(&V_inet_pfil_hook) \
|
||||||
@ -2478,7 +2478,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
|
|||||||
} else {
|
} else {
|
||||||
mc = m_dup(m, M_NOWAIT);
|
mc = m_dup(m, M_NOWAIT);
|
||||||
if (mc == NULL) {
|
if (mc == NULL) {
|
||||||
sc->sc_ifp->if_oerrors++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2498,7 +2498,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if,
|
|||||||
i = min(mc->m_pkthdr.len, max_protohdr);
|
i = min(mc->m_pkthdr.len, max_protohdr);
|
||||||
mc = m_copyup(mc, i, ETHER_ALIGN);
|
mc = m_copyup(mc, i, ETHER_ALIGN);
|
||||||
if (mc == NULL) {
|
if (mc == NULL) {
|
||||||
sc->sc_ifp->if_oerrors++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2541,7 +2541,7 @@ bridge_span(struct bridge_softc *sc, struct mbuf *m)
|
|||||||
|
|
||||||
mc = m_copypacket(m, M_NOWAIT);
|
mc = m_copypacket(m, M_NOWAIT);
|
||||||
if (mc == NULL) {
|
if (mc == NULL) {
|
||||||
sc->sc_ifp->if_oerrors++;
|
if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,8 +174,8 @@ discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
|
|
||||||
m->m_pkthdr.rcvif = ifp;
|
m->m_pkthdr.rcvif = ifp;
|
||||||
|
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
ifp->if_obytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
|
||||||
|
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -291,8 +291,8 @@ edsc_start(struct ifnet *ifp)
|
|||||||
/*
|
/*
|
||||||
* Update the interface counters.
|
* Update the interface counters.
|
||||||
*/
|
*/
|
||||||
ifp->if_obytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finally, just drop the packet.
|
* Finally, just drop the packet.
|
||||||
|
@ -418,7 +418,7 @@ epair_start_locked(struct ifnet *ifp)
|
|||||||
*/
|
*/
|
||||||
if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
|
if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
|
||||||
(oifp->if_flags & IFF_UP) ==0) {
|
(oifp->if_flags & IFF_UP) ==0) {
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -434,15 +434,15 @@ epair_start_locked(struct ifnet *ifp)
|
|||||||
error = netisr_queue(NETISR_EPAIR, m);
|
error = netisr_queue(NETISR_EPAIR, m);
|
||||||
CURVNET_RESTORE();
|
CURVNET_RESTORE();
|
||||||
if (!error) {
|
if (!error) {
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
/* Someone else received the packet. */
|
/* Someone else received the packet. */
|
||||||
oifp->if_ipackets++;
|
if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1);
|
||||||
} else {
|
} else {
|
||||||
/* The packet was freed already. */
|
/* The packet was freed already. */
|
||||||
epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE;
|
epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE;
|
||||||
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
|
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
|
||||||
(void) epair_add_ifp_for_draining(ifp);
|
(void) epair_add_ifp_for_draining(ifp);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
EPAIR_REFCOUNT_RELEASE(&sc->refcount);
|
EPAIR_REFCOUNT_RELEASE(&sc->refcount);
|
||||||
EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1,
|
EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1,
|
||||||
("%s: ifp=%p sc->refcount not >= 1: %d",
|
("%s: ifp=%p sc->refcount not >= 1: %d",
|
||||||
@ -503,7 +503,7 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m)
|
|||||||
oifp = sc->oifp;
|
oifp = sc->oifp;
|
||||||
if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
|
if ((oifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
|
||||||
(oifp->if_flags & IFF_UP) ==0) {
|
(oifp->if_flags & IFF_UP) ==0) {
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -517,12 +517,12 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
|
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
|
||||||
ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error);
|
ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error);
|
||||||
if (error)
|
if (error)
|
||||||
ifp->if_oqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1);
|
||||||
IF_UNLOCK(&ifp->if_snd);
|
IF_UNLOCK(&ifp->if_snd);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
ifp->if_obytes += len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, len);
|
||||||
if (mflags & (M_BCAST|M_MCAST))
|
if (mflags & (M_BCAST|M_MCAST))
|
||||||
ifp->if_omcasts++;
|
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
|
||||||
|
|
||||||
if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0)
|
if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0)
|
||||||
epair_start_locked(ifp);
|
epair_start_locked(ifp);
|
||||||
@ -556,22 +556,22 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m)
|
|||||||
error = netisr_queue(NETISR_EPAIR, m);
|
error = netisr_queue(NETISR_EPAIR, m);
|
||||||
CURVNET_RESTORE();
|
CURVNET_RESTORE();
|
||||||
if (!error) {
|
if (!error) {
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
/*
|
/*
|
||||||
* IFQ_HANDOFF_ADJ/ip_handoff() update statistics,
|
* IFQ_HANDOFF_ADJ/ip_handoff() update statistics,
|
||||||
* but as we bypass all this we have to duplicate
|
* but as we bypass all this we have to duplicate
|
||||||
* the logic another time.
|
* the logic another time.
|
||||||
*/
|
*/
|
||||||
ifp->if_obytes += len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, len);
|
||||||
if (mflags & (M_BCAST|M_MCAST))
|
if (mflags & (M_BCAST|M_MCAST))
|
||||||
ifp->if_omcasts++;
|
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1);
|
||||||
/* Someone else received the packet. */
|
/* Someone else received the packet. */
|
||||||
oifp->if_ipackets++;
|
if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1);
|
||||||
} else {
|
} else {
|
||||||
/* The packet was freed already. */
|
/* The packet was freed already. */
|
||||||
epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE;
|
epair_dpcpu->epair_drv_flags |= IFF_DRV_OACTIVE;
|
||||||
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
|
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
EPAIR_REFCOUNT_RELEASE(&sc->refcount);
|
EPAIR_REFCOUNT_RELEASE(&sc->refcount);
|
||||||
EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1,
|
EPAIR_REFCOUNT_ASSERT((int)sc->refcount >= 1,
|
||||||
("%s: ifp=%p sc->refcount not >= 1: %d",
|
("%s: ifp=%p sc->refcount not >= 1: %d",
|
||||||
|
@ -306,7 +306,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
|
|||||||
update_mbuf_csumflags(m, n);
|
update_mbuf_csumflags(m, n);
|
||||||
(void)if_simloop(ifp, n, dst->sa_family, hlen);
|
(void)if_simloop(ifp, n, dst->sa_family, hlen);
|
||||||
} else
|
} else
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
} else if (bcmp(eh->ether_dhost, eh->ether_shost,
|
} else if (bcmp(eh->ether_dhost, eh->ether_shost,
|
||||||
ETHER_ADDR_LEN) == 0) {
|
ETHER_ADDR_LEN) == 0) {
|
||||||
update_mbuf_csumflags(m, m);
|
update_mbuf_csumflags(m, m);
|
||||||
@ -404,7 +404,7 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
|||||||
*/
|
*/
|
||||||
if ((m->m_flags & M_PKTHDR) == 0) {
|
if ((m->m_flags & M_PKTHDR) == 0) {
|
||||||
if_printf(ifp, "discard frame w/o packet header\n");
|
if_printf(ifp, "discard frame w/o packet header\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if_printf(ifp, "discard frame w/o leading ethernet "
|
if_printf(ifp, "discard frame w/o leading ethernet "
|
||||||
"header (len %u pkt len %u)\n",
|
"header (len %u pkt len %u)\n",
|
||||||
m->m_len, m->m_pkthdr.len);
|
m->m_len, m->m_pkthdr.len);
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
|||||||
etype = ntohs(eh->ether_type);
|
etype = ntohs(eh->ether_type);
|
||||||
if (m->m_pkthdr.rcvif == NULL) {
|
if (m->m_pkthdr.rcvif == NULL) {
|
||||||
if_printf(ifp, "discard frame w/o interface pointer\n");
|
if_printf(ifp, "discard frame w/o interface pointer\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -439,7 +439,7 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
|||||||
m->m_flags |= M_BCAST;
|
m->m_flags |= M_BCAST;
|
||||||
else
|
else
|
||||||
m->m_flags |= M_MCAST;
|
m->m_flags |= M_MCAST;
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
@ -466,7 +466,7 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(ifp->if_capenable & IFCAP_HWSTATS))
|
if (!(ifp->if_capenable & IFCAP_HWSTATS))
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
|
|
||||||
/* Allow monitor mode to claim this frame, after stats are updated. */
|
/* Allow monitor mode to claim this frame, after stats are updated. */
|
||||||
if (ifp->if_flags & IFF_MONITOR) {
|
if (ifp->if_flags & IFF_MONITOR) {
|
||||||
@ -502,7 +502,7 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m)
|
|||||||
#ifdef DIAGNOSTIC
|
#ifdef DIAGNOSTIC
|
||||||
if_printf(ifp, "cannot pullup VLAN header\n");
|
if_printf(ifp, "cannot pullup VLAN header\n");
|
||||||
#endif
|
#endif
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
CURVNET_RESTORE();
|
CURVNET_RESTORE();
|
||||||
return;
|
return;
|
||||||
@ -715,7 +715,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if ((m->m_flags & M_VLANTAG) &&
|
if ((m->m_flags & M_VLANTAG) &&
|
||||||
EVL_VLANOFTAG(m->m_pkthdr.ether_vtag) != 0) {
|
EVL_VLANOFTAG(m->m_pkthdr.ether_vtag) != 0) {
|
||||||
if (ifp->if_vlantrunk == NULL) {
|
if (ifp->if_vlantrunk == NULL) {
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -211,8 +211,8 @@ faithoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
|
return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
|
||||||
rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
|
rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
|
||||||
}
|
}
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
ifp->if_obytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
|
||||||
switch (af) {
|
switch (af) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
@ -232,8 +232,8 @@ faithoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
/* XXX do we need more sanity checks? */
|
/* XXX do we need more sanity checks? */
|
||||||
|
|
||||||
m->m_pkthdr.rcvif = ifp;
|
m->m_pkthdr.rcvif = ifp;
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
netisr_dispatch(isr, m);
|
netisr_dispatch(isr, m);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -288,12 +288,12 @@ fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
|
|
||||||
error = (ifp->if_transmit)(ifp, m);
|
error = (ifp->if_transmit)(ifp, m);
|
||||||
if (error)
|
if (error)
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
if (m)
|
if (m)
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (error);
|
return (error);
|
||||||
@ -317,20 +317,20 @@ fddi_input(ifp, m)
|
|||||||
*/
|
*/
|
||||||
if ((m->m_flags & M_PKTHDR) == 0) {
|
if ((m->m_flags & M_PKTHDR) == 0) {
|
||||||
if_printf(ifp, "discard frame w/o packet header\n");
|
if_printf(ifp, "discard frame w/o packet header\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m->m_pkthdr.rcvif == NULL) {
|
if (m->m_pkthdr.rcvif == NULL) {
|
||||||
if_printf(ifp, "discard frame w/o interface pointer\n");
|
if_printf(ifp, "discard frame w/o interface pointer\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m = m_pullup(m, FDDI_HDR_LEN);
|
m = m_pullup(m, FDDI_HDR_LEN);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
fh = mtod(m, struct fddi_header *);
|
fh = mtod(m, struct fddi_header *);
|
||||||
@ -362,7 +362,7 @@ fddi_input(ifp, m)
|
|||||||
/*
|
/*
|
||||||
* Update interface statistics.
|
* Update interface statistics.
|
||||||
*/
|
*/
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
getmicrotime(&ifp->if_lastchange);
|
getmicrotime(&ifp->if_lastchange);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -383,7 +383,7 @@ fddi_input(ifp, m)
|
|||||||
m->m_flags |= M_BCAST;
|
m->m_flags |= M_BCAST;
|
||||||
else
|
else
|
||||||
m->m_flags |= M_MCAST;
|
m->m_flags |= M_MCAST;
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef M_LINK0
|
#ifdef M_LINK0
|
||||||
@ -401,7 +401,7 @@ fddi_input(ifp, m)
|
|||||||
|
|
||||||
m = m_pullup(m, LLC_SNAPFRAMELEN);
|
m = m_pullup(m, LLC_SNAPFRAMELEN);
|
||||||
if (m == 0) {
|
if (m == 0) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
l = mtod(m, struct llc *);
|
l = mtod(m, struct llc *);
|
||||||
@ -412,13 +412,13 @@ fddi_input(ifp, m)
|
|||||||
u_int16_t type;
|
u_int16_t type;
|
||||||
if ((l->llc_control != LLC_UI) ||
|
if ((l->llc_control != LLC_UI) ||
|
||||||
(l->llc_ssap != LLC_SNAP_LSAP)) {
|
(l->llc_ssap != LLC_SNAP_LSAP)) {
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
if (l->llc_snap.org_code[0] != 0 ||
|
if (l->llc_snap.org_code[0] != 0 ||
|
||||||
l->llc_snap.org_code[1] != 0 ||
|
l->llc_snap.org_code[1] != 0 ||
|
||||||
l->llc_snap.org_code[2] != 0) {
|
l->llc_snap.org_code[2] != 0) {
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ fddi_input(ifp, m)
|
|||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* printf("fddi_input: unknown protocol 0x%x\n", type); */
|
/* printf("fddi_input: unknown protocol 0x%x\n", type); */
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -459,7 +459,7 @@ fddi_input(ifp, m)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
/* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
|
/* printf("fddi_input: unknown dsap 0x%x\n", l->llc_dsap); */
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
M_SETFIB(m, ifp->if_fib);
|
M_SETFIB(m, ifp->if_fib);
|
||||||
@ -467,7 +467,7 @@ fddi_input(ifp, m)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dropanyway:
|
dropanyway:
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
if (m)
|
if (m)
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
|
@ -537,7 +537,7 @@ firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src)
|
|||||||
|
|
||||||
if (m->m_pkthdr.rcvif == NULL) {
|
if (m->m_pkthdr.rcvif == NULL) {
|
||||||
if_printf(ifp, "discard frame w/o interface pointer\n");
|
if_printf(ifp, "discard frame w/o interface pointer\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -582,7 +582,7 @@ firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
|
|
||||||
/* Discard packet if interface is not up */
|
/* Discard packet if interface is not up */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0) {
|
if ((ifp->if_flags & IFF_UP) == 0) {
|
||||||
@ -591,7 +591,7 @@ firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m->m_flags & (M_BCAST|M_MCAST))
|
if (m->m_flags & (M_BCAST|M_MCAST))
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
|
@ -377,10 +377,10 @@ gif_start(struct ifnet *ifp)
|
|||||||
af = AF_LINK;
|
af = AF_LINK;
|
||||||
|
|
||||||
BPF_MTAP2(ifp, &af, sizeof(af), m);
|
BPF_MTAP2(ifp, &af, sizeof(af), m);
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
|
|
||||||
/* Done by IFQ_HANDOFF */
|
/* Done by IFQ_HANDOFF */
|
||||||
/* ifp->if_obytes += m->m_pkthdr.len;*/
|
/* if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);*/
|
||||||
/* override to IPPROTO_ETHERIP for bridged traffic */
|
/* override to IPPROTO_ETHERIP for bridged traffic */
|
||||||
|
|
||||||
M_SETFIB(m, sc->gif_fibnum);
|
M_SETFIB(m, sc->gif_fibnum);
|
||||||
@ -403,7 +403,7 @@ gif_start(struct ifnet *ifp)
|
|||||||
error = ENETDOWN;
|
error = ENETDOWN;
|
||||||
}
|
}
|
||||||
if (error)
|
if (error)
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
||||||
@ -513,7 +513,7 @@ gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
IFQ_HANDOFF(ifp, m, error);
|
IFQ_HANDOFF(ifp, m, error);
|
||||||
end:
|
end:
|
||||||
if (error)
|
if (error)
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,8 +544,8 @@ gif_input(struct mbuf *m, int af, struct ifnet *ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ifp->if_flags & IFF_MONITOR) != 0) {
|
if ((ifp->if_flags & IFF_MONITOR) != 0) {
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -583,7 +583,7 @@ gif_input(struct mbuf *m, int af, struct ifnet *ifp)
|
|||||||
if (n > m->m_len) {
|
if (n > m->m_len) {
|
||||||
m = m_pullup(m, n);
|
m = m_pullup(m, n);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -622,7 +622,7 @@ gif_input(struct mbuf *m, int af, struct ifnet *ifp)
|
|||||||
m->m_flags |= M_BCAST;
|
m->m_flags |= M_BCAST;
|
||||||
else
|
else
|
||||||
m->m_flags |= M_MCAST;
|
m->m_flags |= M_MCAST;
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
}
|
}
|
||||||
BRIDGE_INPUT(ifp, m);
|
BRIDGE_INPUT(ifp, m);
|
||||||
|
|
||||||
@ -647,8 +647,8 @@ gif_input(struct mbuf *m, int af, struct ifnet *ifp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
M_SETFIB(m, ifp->if_fib);
|
M_SETFIB(m, ifp->if_fib);
|
||||||
netisr_dispatch(isr, m);
|
netisr_dispatch(isr, m);
|
||||||
}
|
}
|
||||||
|
@ -361,7 +361,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
* be encapsulated.
|
* be encapsulated.
|
||||||
*/
|
*/
|
||||||
if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) {
|
if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) {
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
error = EINVAL; /* is there better errno? */
|
error = EINVAL; /* is there better errno? */
|
||||||
goto end;
|
goto end;
|
||||||
@ -390,7 +390,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
if ((m->m_data - msiz) < m->m_pktdat) {
|
if ((m->m_data - msiz) < m->m_pktdat) {
|
||||||
m0 = m_gethdr(M_NOWAIT, MT_DATA);
|
m0 = m_gethdr(M_NOWAIT, MT_DATA);
|
||||||
if (m0 == NULL) {
|
if (m0 == NULL) {
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
error = ENOBUFS;
|
error = ENOBUFS;
|
||||||
goto end;
|
goto end;
|
||||||
@ -415,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz);
|
memcpy((caddr_t)(ip + 1), &mob_h, (unsigned)msiz);
|
||||||
ip->ip_len = htons(ntohs(ip->ip_len) + msiz);
|
ip->ip_len = htons(ntohs(ip->ip_len) + msiz);
|
||||||
} else { /* AF_INET */
|
} else { /* AF_INET */
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
goto end;
|
goto end;
|
||||||
@ -440,7 +440,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
error = EAFNOSUPPORT;
|
error = EAFNOSUPPORT;
|
||||||
goto end;
|
goto end;
|
||||||
@ -452,14 +452,14 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
hdrlen += sizeof(uint32_t);
|
hdrlen += sizeof(uint32_t);
|
||||||
M_PREPEND(m, hdrlen, M_NOWAIT);
|
M_PREPEND(m, hdrlen, M_NOWAIT);
|
||||||
} else {
|
} else {
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m == NULL) { /* mbuf allocation failed */
|
if (m == NULL) { /* mbuf allocation failed */
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
error = ENOBUFS;
|
error = ENOBUFS;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@ -494,8 +494,8 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
gh->gi_len = htons(m->m_pkthdr.len);
|
gh->gi_len = htons(m->m_pkthdr.len);
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
ifp->if_obytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
|
||||||
/*
|
/*
|
||||||
* Send it off and with IP_FORWARD flag to prevent it from
|
* Send it off and with IP_FORWARD flag to prevent it from
|
||||||
* overwriting the ip_id again. ip_id is already set to the
|
* overwriting the ip_id again. ip_id is already set to the
|
||||||
@ -505,7 +505,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
(struct ip_moptions *)NULL, (struct inpcb *)NULL);
|
(struct ip_moptions *)NULL, (struct inpcb *)NULL);
|
||||||
end:
|
end:
|
||||||
if (error)
|
if (error)
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,12 +381,12 @@ iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
IFQ_HANDOFF_ADJ(ifp, m, ISO88025_HDR_LEN + LLC_SNAPFRAMELEN, error);
|
IFQ_HANDOFF_ADJ(ifp, m, ISO88025_HDR_LEN + LLC_SNAPFRAMELEN, error);
|
||||||
if (error) {
|
if (error) {
|
||||||
printf("iso88025_output: packet dropped QFULL.\n");
|
printf("iso88025_output: packet dropped QFULL.\n");
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
}
|
}
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
if (m)
|
if (m)
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (error);
|
return (error);
|
||||||
@ -411,20 +411,20 @@ iso88025_input(ifp, m)
|
|||||||
*/
|
*/
|
||||||
if ((m->m_flags & M_PKTHDR) == 0) {
|
if ((m->m_flags & M_PKTHDR) == 0) {
|
||||||
if_printf(ifp, "discard frame w/o packet header\n");
|
if_printf(ifp, "discard frame w/o packet header\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m->m_pkthdr.rcvif == NULL) {
|
if (m->m_pkthdr.rcvif == NULL) {
|
||||||
if_printf(ifp, "discard frame w/o interface pointer\n");
|
if_printf(ifp, "discard frame w/o interface pointer\n");
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m = m_pullup(m, ISO88025_HDR_LEN);
|
m = m_pullup(m, ISO88025_HDR_LEN);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
th = mtod(m, struct iso88025_header *);
|
th = mtod(m, struct iso88025_header *);
|
||||||
@ -456,7 +456,7 @@ iso88025_input(ifp, m)
|
|||||||
/*
|
/*
|
||||||
* Update interface statistics.
|
* Update interface statistics.
|
||||||
*/
|
*/
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
getmicrotime(&ifp->if_lastchange);
|
getmicrotime(&ifp->if_lastchange);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -478,7 +478,7 @@ iso88025_input(ifp, m)
|
|||||||
m->m_flags |= M_BCAST;
|
m->m_flags |= M_BCAST;
|
||||||
else
|
else
|
||||||
m->m_flags |= M_MCAST;
|
m->m_flags |= M_MCAST;
|
||||||
ifp->if_imcasts++;
|
if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
mac_hdr_len = ISO88025_HDR_LEN;
|
mac_hdr_len = ISO88025_HDR_LEN;
|
||||||
@ -491,7 +491,7 @@ iso88025_input(ifp, m)
|
|||||||
|
|
||||||
m = m_pullup(m, LLC_SNAPFRAMELEN);
|
m = m_pullup(m, LLC_SNAPFRAMELEN);
|
||||||
if (m == 0) {
|
if (m == 0) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
l = mtod(m, struct llc *);
|
l = mtod(m, struct llc *);
|
||||||
@ -501,14 +501,14 @@ iso88025_input(ifp, m)
|
|||||||
u_int16_t type;
|
u_int16_t type;
|
||||||
if ((l->llc_control != LLC_UI) ||
|
if ((l->llc_control != LLC_UI) ||
|
||||||
(l->llc_ssap != LLC_SNAP_LSAP)) {
|
(l->llc_ssap != LLC_SNAP_LSAP)) {
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (l->llc_snap.org_code[0] != 0 ||
|
if (l->llc_snap.org_code[0] != 0 ||
|
||||||
l->llc_snap.org_code[1] != 0 ||
|
l->llc_snap.org_code[1] != 0 ||
|
||||||
l->llc_snap.org_code[2] != 0) {
|
l->llc_snap.org_code[2] != 0) {
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ iso88025_input(ifp, m)
|
|||||||
#endif /* INET6 */
|
#endif /* INET6 */
|
||||||
default:
|
default:
|
||||||
printf("iso88025_input: unexpected llc_snap ether_type 0x%02x\n", type);
|
printf("iso88025_input: unexpected llc_snap ether_type 0x%02x\n", type);
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -546,7 +546,7 @@ iso88025_input(ifp, m)
|
|||||||
case LLC_ISO_LSAP:
|
case LLC_ISO_LSAP:
|
||||||
switch (l->llc_control) {
|
switch (l->llc_control) {
|
||||||
case LLC_UI:
|
case LLC_UI:
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
break;
|
break;
|
||||||
case LLC_XID:
|
case LLC_XID:
|
||||||
@ -595,7 +595,7 @@ iso88025_input(ifp, m)
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
printf("iso88025_input: unexpected llc control 0x%02x\n", l->llc_control);
|
printf("iso88025_input: unexpected llc control 0x%02x\n", l->llc_control);
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ iso88025_input(ifp, m)
|
|||||||
#endif /* ISO */
|
#endif /* ISO */
|
||||||
default:
|
default:
|
||||||
printf("iso88025_input: unknown dsap 0x%x\n", l->llc_dsap);
|
printf("iso88025_input: unknown dsap 0x%x\n", l->llc_dsap);
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto dropanyway;
|
goto dropanyway;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -613,7 +613,7 @@ iso88025_input(ifp, m)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dropanyway:
|
dropanyway:
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
if (m)
|
if (m)
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return;
|
return;
|
||||||
|
@ -226,8 +226,8 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
|
rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
ifp->if_obytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
|
||||||
|
|
||||||
/* BPF writes need to be handled specially. */
|
/* BPF writes need to be handled specially. */
|
||||||
if (dst->sa_family == AF_UNSPEC)
|
if (dst->sa_family == AF_UNSPEC)
|
||||||
@ -358,8 +358,8 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen)
|
|||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (EAFNOSUPPORT);
|
return (EAFNOSUPPORT);
|
||||||
}
|
}
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
netisr_queue(isr, m); /* mbuf is free'd on failure. */
|
netisr_queue(isr, m); /* mbuf is free'd on failure. */
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -250,9 +250,9 @@ bad: m_freem (m);
|
|||||||
|
|
||||||
switch (proto) {
|
switch (proto) {
|
||||||
default:
|
default:
|
||||||
++ifp->if_noproto;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
drop: ++ifp->if_ierrors;
|
drop: if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
++ifp->if_iqdrops;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
m_freem (m);
|
m_freem (m);
|
||||||
return;
|
return;
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
@ -394,7 +394,7 @@ void sppp_fr_keepalive (struct sppp *sp)
|
|||||||
(u_char) sp->pp_rseq[IDX_LCP]);
|
(u_char) sp->pp_rseq[IDX_LCP]);
|
||||||
|
|
||||||
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
||||||
++ifp->if_oerrors;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -508,7 +508,7 @@ static void sppp_fr_arp (struct sppp *sp, struct arp_req *req,
|
|||||||
reply->ptarget2 = htonl (his_ip_address) >> 16;
|
reply->ptarget2 = htonl (his_ip_address) >> 16;
|
||||||
|
|
||||||
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
||||||
++ifp->if_oerrors;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -518,7 +518,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
|
|
||||||
if (ifp->if_flags & IFF_UP)
|
if (ifp->if_flags & IFF_UP)
|
||||||
/* Count received bytes, add FCS and one flag */
|
/* Count received bytes, add FCS and one flag */
|
||||||
ifp->if_ibytes += m->m_pkthdr.len + 3;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len + 3);
|
||||||
|
|
||||||
if (m->m_pkthdr.len <= PPP_HEADER_LEN) {
|
if (m->m_pkthdr.len <= PPP_HEADER_LEN) {
|
||||||
/* Too small packet, drop it. */
|
/* Too small packet, drop it. */
|
||||||
@ -530,8 +530,8 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
m_freem (m);
|
m_freem (m);
|
||||||
SPPP_UNLOCK(sp);
|
SPPP_UNLOCK(sp);
|
||||||
drop2:
|
drop2:
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
++ifp->if_iqdrops;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,7 +570,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
sppp_cp_send (sp, PPP_LCP, PROTO_REJ,
|
sppp_cp_send (sp, PPP_LCP, PROTO_REJ,
|
||||||
++sp->pp_seq[IDX_LCP], m->m_pkthdr.len + 2,
|
++sp->pp_seq[IDX_LCP], m->m_pkthdr.len + 2,
|
||||||
&h->protocol);
|
&h->protocol);
|
||||||
++ifp->if_noproto;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto drop;
|
goto drop;
|
||||||
case PPP_LCP:
|
case PPP_LCP:
|
||||||
sppp_cp_input(&lcp, sp, m);
|
sppp_cp_input(&lcp, sp, m);
|
||||||
@ -682,7 +682,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
}
|
}
|
||||||
switch (ntohs (h->protocol)) {
|
switch (ntohs (h->protocol)) {
|
||||||
default:
|
default:
|
||||||
++ifp->if_noproto;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
goto invalid;
|
goto invalid;
|
||||||
case CISCO_KEEPALIVE:
|
case CISCO_KEEPALIVE:
|
||||||
sppp_cisco_input (sp, m);
|
sppp_cisco_input (sp, m);
|
||||||
@ -906,7 +906,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
nobufs: if (debug)
|
nobufs: if (debug)
|
||||||
log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n",
|
log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n",
|
||||||
SPP_ARGS(ifp));
|
SPP_ARGS(ifp));
|
||||||
++ifp->if_oerrors;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
SPPP_UNLOCK(sp);
|
SPPP_UNLOCK(sp);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
}
|
}
|
||||||
@ -966,7 +966,7 @@ nobufs: if (debug)
|
|||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
m_freem (m);
|
m_freem (m);
|
||||||
++ifp->if_oerrors;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
SPPP_UNLOCK(sp);
|
SPPP_UNLOCK(sp);
|
||||||
return (EAFNOSUPPORT);
|
return (EAFNOSUPPORT);
|
||||||
}
|
}
|
||||||
@ -981,7 +981,7 @@ nobufs: if (debug)
|
|||||||
else
|
else
|
||||||
IFQ_HANDOFF_ADJ(ifp, m, 3, error);
|
IFQ_HANDOFF_ADJ(ifp, m, 3, error);
|
||||||
if (error) {
|
if (error) {
|
||||||
++ifp->if_oerrors;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
SPPP_UNLOCK(sp);
|
SPPP_UNLOCK(sp);
|
||||||
return (rv? rv: ENOBUFS);
|
return (rv? rv: ENOBUFS);
|
||||||
}
|
}
|
||||||
@ -1393,7 +1393,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2)
|
|||||||
(u_long)ch->par2, (u_int)ch->rel, (u_int)ch->time0, (u_int)ch->time1);
|
(u_long)ch->par2, (u_int)ch->rel, (u_int)ch->time0, (u_int)ch->time1);
|
||||||
|
|
||||||
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1442,7 +1442,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
|
|||||||
log(-1, ">\n");
|
log(-1, ">\n");
|
||||||
}
|
}
|
||||||
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1484,7 +1484,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
log(-1, SPP_FMT "%s invalid conf-req length %d\n",
|
log(-1, SPP_FMT "%s invalid conf-req length %d\n",
|
||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
len);
|
len);
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* handle states where RCR doesn't get a SCA/SCN */
|
/* handle states where RCR doesn't get a SCA/SCN */
|
||||||
@ -1540,7 +1540,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CONF_ACK:
|
case CONF_ACK:
|
||||||
@ -1549,7 +1549,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
|
log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
|
||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
h->ident, sp->confid[cp->protoidx]);
|
h->ident, sp->confid[cp->protoidx]);
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (sp->state[cp->protoidx]) {
|
switch (sp->state[cp->protoidx]) {
|
||||||
@ -1584,7 +1584,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CONF_NAK:
|
case CONF_NAK:
|
||||||
@ -1594,7 +1594,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
|
log(-1, SPP_FMT "%s id mismatch 0x%x != 0x%x\n",
|
||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
h->ident, sp->confid[cp->protoidx]);
|
h->ident, sp->confid[cp->protoidx]);
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (h->type == CONF_NAK)
|
if (h->type == CONF_NAK)
|
||||||
@ -1634,7 +1634,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1667,7 +1667,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TERM_ACK:
|
case TERM_ACK:
|
||||||
@ -1698,7 +1698,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CODE_REJ:
|
case CODE_REJ:
|
||||||
@ -1725,7 +1725,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROTO_REJ:
|
case PROTO_REJ:
|
||||||
@ -1784,7 +1784,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name,
|
SPP_ARGS(ifp), cp->name,
|
||||||
sppp_cp_type_name(h->type),
|
sppp_cp_type_name(h->type),
|
||||||
sppp_state_name(sp->state[cp->protoidx]));
|
sppp_state_name(sp->state[cp->protoidx]));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1800,7 +1800,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
if (debug)
|
if (debug)
|
||||||
log(-1, SPP_FMT "lcp echo req but lcp closed\n",
|
log(-1, SPP_FMT "lcp echo req but lcp closed\n",
|
||||||
SPP_ARGS(ifp));
|
SPP_ARGS(ifp));
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (len < 8) {
|
if (len < 8) {
|
||||||
@ -1834,7 +1834,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
if (cp->proto != PPP_LCP)
|
if (cp->proto != PPP_LCP)
|
||||||
goto illegal;
|
goto illegal;
|
||||||
if (h->ident != sp->lcp.echoid) {
|
if (h->ident != sp->lcp.echoid) {
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (len < 8) {
|
if (len < 8) {
|
||||||
@ -1859,7 +1859,7 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
|
|||||||
SPP_ARGS(ifp), cp->name, h->type);
|
SPP_ARGS(ifp), cp->name, h->type);
|
||||||
sppp_cp_send(sp, cp->proto, CODE_REJ,
|
sppp_cp_send(sp, cp->proto, CODE_REJ,
|
||||||
++sp->pp_seq[cp->protoidx], m->m_pkthdr.len, h);
|
++sp->pp_seq[cp->protoidx], m->m_pkthdr.len, h);
|
||||||
++ifp->if_ierrors;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4740,7 +4740,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp,
|
|||||||
log(-1, ">\n");
|
log(-1, ">\n");
|
||||||
}
|
}
|
||||||
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -442,7 +442,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
/* just in case */
|
/* just in case */
|
||||||
if ((ifp->if_flags & IFF_UP) == 0) {
|
if ((ifp->if_flags & IFF_UP) == 0) {
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return ENETDOWN;
|
return ENETDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
ia6 = stf_getsrcifa6(ifp);
|
ia6 = stf_getsrcifa6(ifp);
|
||||||
if (ia6 == NULL) {
|
if (ia6 == NULL) {
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return ENETDOWN;
|
return ENETDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,7 +462,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
m = m_pullup(m, sizeof(*ip6));
|
m = m_pullup(m, sizeof(*ip6));
|
||||||
if (!m) {
|
if (!m) {
|
||||||
ifa_free(&ia6->ia_ifa);
|
ifa_free(&ia6->ia_ifa);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return ENOBUFS;
|
return ENOBUFS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -481,7 +481,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
else {
|
else {
|
||||||
ifa_free(&ia6->ia_ifa);
|
ifa_free(&ia6->ia_ifa);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return ENETUNREACH;
|
return ENETUNREACH;
|
||||||
}
|
}
|
||||||
bcopy(ptr, &in4, sizeof(in4));
|
bcopy(ptr, &in4, sizeof(in4));
|
||||||
@ -503,7 +503,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
m = m_pullup(m, sizeof(struct ip));
|
m = m_pullup(m, sizeof(struct ip));
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
ifa_free(&ia6->ia_ifa);
|
ifa_free(&ia6->ia_ifa);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return ENOBUFS;
|
return ENOBUFS;
|
||||||
}
|
}
|
||||||
ip = mtod(m, struct ip *);
|
ip = mtod(m, struct ip *);
|
||||||
@ -549,7 +549,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
if (sc->sc_ro.ro_rt == NULL) {
|
if (sc->sc_ro.ro_rt == NULL) {
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
mtx_unlock(&(sc)->sc_ro_mtx);
|
mtx_unlock(&(sc)->sc_ro_mtx);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return ENETUNREACH;
|
return ENETUNREACH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -557,7 +557,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
|||||||
|
|
||||||
sendit:
|
sendit:
|
||||||
M_SETFIB(m, sc->sc_fibnum);
|
M_SETFIB(m, sc->sc_fibnum);
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
error = ip_output(m, NULL, cached_route, 0, NULL, NULL);
|
error = ip_output(m, NULL, cached_route, 0, NULL, NULL);
|
||||||
|
|
||||||
if (cached_route != NULL)
|
if (cached_route != NULL)
|
||||||
@ -770,8 +770,8 @@ in_stf_input(struct mbuf **mp, int *offp, int proto)
|
|||||||
* See net/if_gif.c for possible issues with packet processing
|
* See net/if_gif.c for possible issues with packet processing
|
||||||
* reorder due to extra queueing.
|
* reorder due to extra queueing.
|
||||||
*/
|
*/
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
M_SETFIB(m, ifp->if_fib);
|
M_SETFIB(m, ifp->if_fib);
|
||||||
netisr_dispatch(NETISR_IPV6, m);
|
netisr_dispatch(NETISR_IPV6, m);
|
||||||
return (IPPROTO_DONE);
|
return (IPPROTO_DONE);
|
||||||
|
@ -682,7 +682,7 @@ tapifstart(struct ifnet *ifp)
|
|||||||
IF_DEQUEUE(&ifp->if_snd, m);
|
IF_DEQUEUE(&ifp->if_snd, m);
|
||||||
if (m != NULL) {
|
if (m != NULL) {
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -707,7 +707,7 @@ tapifstart(struct ifnet *ifp)
|
|||||||
|
|
||||||
selwakeuppri(&tp->tap_rsel, PZERO+1);
|
selwakeuppri(&tp->tap_rsel, PZERO+1);
|
||||||
KNOTE_LOCKED(&tp->tap_rsel.si_note, 0);
|
KNOTE_LOCKED(&tp->tap_rsel.si_note, 0);
|
||||||
ifp->if_opackets ++; /* obytes are counted in ether_output */
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* obytes are counted in ether_output */
|
||||||
}
|
}
|
||||||
|
|
||||||
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
||||||
@ -947,7 +947,7 @@ tapwrite(struct cdev *dev, struct uio *uio, int flag)
|
|||||||
|
|
||||||
if ((m = m_uiotombuf(uio, M_NOWAIT, 0, ETHER_ALIGN,
|
if ((m = m_uiotombuf(uio, M_NOWAIT, 0, ETHER_ALIGN,
|
||||||
M_PKTHDR)) == NULL) {
|
M_PKTHDR)) == NULL) {
|
||||||
ifp->if_ierrors ++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -974,7 +974,7 @@ tapwrite(struct cdev *dev, struct uio *uio, int flag)
|
|||||||
CURVNET_SET(ifp->if_vnet);
|
CURVNET_SET(ifp->if_vnet);
|
||||||
(*ifp->if_input)(ifp, m);
|
(*ifp->if_input)(ifp, m);
|
||||||
CURVNET_RESTORE();
|
CURVNET_RESTORE();
|
||||||
ifp->if_ipackets ++; /* ibytes are counted in parent */
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* ibytes are counted in parent */
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
} /* tapwrite */
|
} /* tapwrite */
|
||||||
|
@ -619,8 +619,8 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
|||||||
|
|
||||||
/* if allocation failed drop packet */
|
/* if allocation failed drop packet */
|
||||||
if (m0 == NULL) {
|
if (m0 == NULL) {
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
} else {
|
} else {
|
||||||
bcopy(dst, m0->m_data, dst->sa_len);
|
bcopy(dst, m0->m_data, dst->sa_len);
|
||||||
@ -633,8 +633,8 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
|||||||
|
|
||||||
/* if allocation failed drop packet */
|
/* if allocation failed drop packet */
|
||||||
if (m0 == NULL) {
|
if (m0 == NULL) {
|
||||||
ifp->if_iqdrops++;
|
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||||
ifp->if_oerrors++;
|
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
} else
|
} else
|
||||||
*(u_int32_t *)m0->m_data = htonl(af);
|
*(u_int32_t *)m0->m_data = htonl(af);
|
||||||
@ -651,7 +651,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
|||||||
error = (ifp->if_transmit)(ifp, m0);
|
error = (ifp->if_transmit)(ifp, m0);
|
||||||
if (error)
|
if (error)
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
ifp->if_opackets++;
|
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -866,7 +866,7 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) {
|
if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) {
|
||||||
ifp->if_ierrors++;
|
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||||
return (ENOBUFS);
|
return (ENOBUFS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,8 +908,8 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag)
|
|||||||
}
|
}
|
||||||
if (harvest.point_to_point)
|
if (harvest.point_to_point)
|
||||||
random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN);
|
random_harvest(&(m->m_data), 12, 2, RANDOM_NET_TUN);
|
||||||
ifp->if_ibytes += m->m_pkthdr.len;
|
if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
|
||||||
ifp->if_ipackets++;
|
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||||
CURVNET_SET(ifp->if_vnet);
|
CURVNET_SET(ifp->if_vnet);
|
||||||
M_SETFIB(m, ifp->if_fib);
|
M_SETFIB(m, ifp->if_fib);
|
||||||
netisr_dispatch(isr, m);
|
netisr_dispatch(isr, m);
|
||||||
|
@ -1215,7 +1215,7 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
__func__, ifp->if_xname, ifp->if_type);
|
__func__, ifp->if_xname, ifp->if_type);
|
||||||
#endif
|
#endif
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1225,7 +1225,7 @@ vlan_input(struct ifnet *ifp, struct mbuf *m)
|
|||||||
if (ifv == NULL || !UP_AND_RUNNING(ifv->ifv_ifp)) {
|
if (ifv == NULL || !UP_AND_RUNNING(ifv->ifv_ifp)) {
|
||||||
TRUNK_RUNLOCK(trunk);
|
TRUNK_RUNLOCK(trunk);
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
ifp->if_noproto++;
|
if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TRUNK_RUNLOCK(trunk);
|
TRUNK_RUNLOCK(trunk);
|
||||||
|
Loading…
Reference in New Issue
Block a user