aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorJosef Karthauser <joe@FreeBSD.org>2000-10-19 23:15:54 +0000
committerJosef Karthauser <joe@FreeBSD.org>2000-10-19 23:15:54 +0000
commit5da9f8fa978ae925af826ba78653757d2c84c9c1 (patch)
tree9f0fe3f2362be5fa75a25ca05077a78bfe2418f0 /sys/netinet6
parent7ae6b1ebd284680b965c4ce38b7d3923cd7196fe (diff)
Notes
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_input.c5
-rw-r--r--sys/netinet6/ip6_output.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 46f0b9ce8c78..7e83bf5ed86a 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -493,6 +493,11 @@ ip6_input(m)
/* this address is ready */
ours = 1;
deliverifp = ia6->ia_ifp; /* correct? */
+
+ /* Count the packet in the ip address stats */
+ ia6->ia_ifa.if_ipackets++;
+ ia6->ia_ifa.if_ibytes += m->m_pkthdr.len;
+
goto hbhcheck;
} else {
/* address is not ready, so discard the packet. */
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index c17070ce711a..4f1bd4cabe1b 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -156,7 +156,7 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp)
struct route_in6 ip6route;
struct sockaddr_in6 *dst;
int error = 0;
- struct in6_ifaddr *ia;
+ struct in6_ifaddr *ia = NULL;
u_long mtu;
u_int32_t optlen = 0, plen = 0, unfragpartlen = 0;
struct ip6_exthdrs exthdrs;
@@ -890,6 +890,12 @@ skip_ipsec2:;
#endif
)
{
+ /* Record statistics for this interface address. */
+ if (ia && !(flags & IPV6_FORWARDING)) {
+ ia->ia_ifa.if_opackets++;
+ ia->ia_ifa.if_obytes += m->m_pkthdr.len;
+ }
+
error = nd6_output(ifp, origifp, m, dst, ro->ro_rt);
goto done;
} else if (mtu < IPV6_MMTU) {