From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:31:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E5DA4C8; Tue, 16 Apr 2013 11:31:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 110E9350; Tue, 16 Apr 2013 11:31:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBVQ5D024582; Tue, 16 Apr 2013 11:31:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBVQNc024581; Tue, 16 Apr 2013 11:31:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161131.r3GBVQNc024581@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249546 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:31:27 -0000 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); }