summaryrefslogtreecommitdiffstats
path: root/sys/net/if_stf.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2002-09-17 14:25:19 +0000
committerume <ume@FreeBSD.org>2002-09-17 14:25:19 +0000
commit3596f40025b63816ea6dde46e2ffb80020eb33e4 (patch)
tree4d3b97b7b8af13aab3cdaa8fac46b12b27e81ebe /sys/net/if_stf.c
parentda2ba83f7bf19cb960eb8d0a1716788f1055deb6 (diff)
downloadFreeBSD-src-3596f40025b63816ea6dde46e2ffb80020eb33e4.zip
FreeBSD-src-3596f40025b63816ea6dde46e2ffb80020eb33e4.tar.gz
- increment interface output counter. sync w/ netbsd-current
- increase if_oerrors. sync w/netbsd Obtained from: KAME
Diffstat (limited to 'sys/net/if_stf.c')
-rw-r--r--sys/net/if_stf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 8323e07..dcbd14c 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -362,6 +362,7 @@ stf_output(ifp, m, dst, rt)
/* just in case */
if ((ifp->if_flags & IFF_UP) == 0) {
m_freem(m);
+ ifp->if_oerrors++;
return ENETDOWN;
}
@@ -373,13 +374,16 @@ stf_output(ifp, m, dst, rt)
ia6 = stf_getsrcifa6(ifp);
if (ia6 == NULL) {
m_freem(m);
+ ifp->if_oerrors++;
return ENETDOWN;
}
if (m->m_len < sizeof(*ip6)) {
m = m_pullup(m, sizeof(*ip6));
- if (!m)
+ if (!m) {
+ ifp->if_oerrors++;
return ENOBUFS;
+ }
}
ip6 = mtod(m, struct ip6_hdr *);
tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
@@ -394,6 +398,7 @@ stf_output(ifp, m, dst, rt)
in4 = GET_V4(&dst6->sin6_addr);
else {
m_freem(m);
+ ifp->if_oerrors++;
return ENETUNREACH;
}
@@ -424,8 +429,10 @@ stf_output(ifp, m, dst, rt)
M_PREPEND(m, sizeof(struct ip), M_DONTWAIT);
if (m && m->m_len < sizeof(struct ip))
m = m_pullup(m, sizeof(struct ip));
- if (m == NULL)
+ if (m == NULL) {
+ ifp->if_oerrors++;
return ENOBUFS;
+ }
ip = mtod(m, struct ip *);
bzero(ip, sizeof(*ip));
@@ -458,10 +465,12 @@ stf_output(ifp, m, dst, rt)
rtalloc(&sc->sc_ro);
if (sc->sc_ro.ro_rt == NULL) {
m_freem(m);
+ ifp->if_oerrors++;
return ENETUNREACH;
}
}
+ ifp->if_opackets++;
return ip_output(m, NULL, &sc->sc_ro, 0, NULL);
}
OpenPOWER on IntegriCloud