summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-10-29 01:05:09 +0000
committerjoe <joe@FreeBSD.org>2000-10-29 01:05:09 +0000
commit1ade5b1eab73d10a65241fbbd57c9c5fc68012c0 (patch)
tree76552212b318f1173f304e318d9402b7ce7993b5 /sys
parentcdd71a9d715a944e7fc2d70376e9a62ac5c0ab47 (diff)
downloadFreeBSD-src-1ade5b1eab73d10a65241fbbd57c9c5fc68012c0.zip
FreeBSD-src-1ade5b1eab73d10a65241fbbd57c9c5fc68012c0.tar.gz
Count per-address statistics for IP fragments.
Requested by: ru Obtained from: BSD/OS
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_output.c8
-rw-r--r--sys/netinet6/ip6_output.c6
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 7c166b7..ed3d873 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -934,10 +934,14 @@ sendorfree:
for (m = m0; m; m = m0) {
m0 = m->m_nextpkt;
m->m_nextpkt = 0;
- if (error == 0)
+ if (error == 0) {
+ /* Record statistics for this interface address. */
+ ia->ia_ifa.if_opackets++;
+ ia->ia_ifa.if_obytes += m->m_pkthdr.len;
+
error = (*ifp->if_output)(ifp, m,
(struct sockaddr *)dst, ro->ro_rt);
- else
+ } else
m_freem(m);
}
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 4f1bd4c..328e7ea 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1012,6 +1012,12 @@ sendorfree:
m0 = m->m_nextpkt;
m->m_nextpkt = 0;
if (error == 0) {
+ /* Record statistics for this interface address. */
+ if (ia) {
+ ia->ia_ifa.if_opackets++;
+ ia->ia_ifa.if_obytes += m->m_pkthdr.len;
+ }
+
error = nd6_output(ifp, origifp, m, dst, ro->ro_rt);
} else
m_freem(m);
OpenPOWER on IntegriCloud