Author: ae
Date: Tue Apr 16 11:31:26 2013
New Revision: 249546
URL: http://svnweb.freebsd.org/changeset/base/249546

Log:
  Fix accounting after the r249528, also add several another counters to
  the statistics.

Modified:
  head/sys/netinet6/in6_src.c

Modified: head/sys/netinet6/in6_src.c
==============================================================================
--- head/sys/netinet6/in6_src.c Tue Apr 16 11:25:45 2013        (r249545)
+++ head/sys/netinet6/in6_src.c Tue Apr 16 11:31:26 2013        (r249546)
@@ -151,6 +151,7 @@ static struct in6_addrpolicy *match_addr
  * 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_addr
        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 *dstso
                *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);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to