diff options
author | ae <ae@FreeBSD.org> | 2013-04-16 11:31:26 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2013-04-16 11:31:26 +0000 |
commit | 586b63d9f3b139126c506e8c59194370ee83497b (patch) | |
tree | 569daa490aa5e0c421c93fda5a25410ba9c2c2a9 /sys/netinet6/in6_src.c | |
parent | 7d578335bd68cc31ad302d30f012f805f354ec88 (diff) | |
download | FreeBSD-src-586b63d9f3b139126c506e8c59194370ee83497b.zip FreeBSD-src-586b63d9f3b139126c506e8c59194370ee83497b.tar.gz |
Fix accounting after the r249528, also add several another counters to
the statistics.
Diffstat (limited to 'sys/netinet6/in6_src.c')
-rw-r--r-- | sys/netinet6/in6_src.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 7a2c6bc..7590fa1 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -151,6 +151,7 @@ static struct in6_addrpolicy *match_addrsel_policy(struct sockaddr_in6 *); * an entry to the caller for later use. */ #define REPLACE(r) do {\ + IP6STAT_INC(ip6s_sources_rule[(r)]); \ rule = (r); \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ @@ -166,6 +167,7 @@ static struct in6_addrpolicy *match_addrsel_policy(struct sockaddr_in6 *); goto next; /* XXX: we can't use 'continue' here */ \ } while(0) #define BREAK(r) do { \ + IP6STAT_INC(ip6s_sources_rule[(r)]); \ rule = (r); \ goto out; /* XXX: we can't use 'break' here */ \ } while(0) @@ -506,8 +508,17 @@ in6_selectsrc(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts, *ifpp = ifp; bcopy(&tmp, srcp, sizeof(*srcp)); + if (ia->ia_ifp == ifp) + IP6STAT_INC(ip6s_sources_sameif[best_scope]); + else + IP6STAT_INC(ip6s_sources_otherif[best_scope]); + if (dst_scope == best_scope) + IP6STAT_INC(ip6s_sources_samescope[best_scope]); + else + IP6STAT_INC(ip6s_sources_otherscope[best_scope]); + if (IFA6_IS_DEPRECATED(ia)) + IP6STAT_INC(ip6s_sources_deprecated[best_scope]); IN6_IFADDR_RUNLOCK(); - IP6STAT_INC(ip6s_sources_rule[rule]); return (0); } |