Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 simplify per-if stats.



details:   https://anonhg.NetBSD.org/src/rev/be363fac125e
branches:  trunk
changeset: 516188:be363fac125e
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Oct 18 09:09:25 2001 +0000

description:
simplify per-if stats.

diffstat:

 sys/netinet6/icmp6.c |  13 +++++--------
 sys/netinet6/mld6.c  |  29 +++++++++++++----------------
 2 files changed, 18 insertions(+), 24 deletions(-)

diffs (83 lines):

diff -r fbd8f89d0e54 -r be363fac125e sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c      Thu Oct 18 08:03:46 2001 +0000
+++ b/sys/netinet6/icmp6.c      Thu Oct 18 09:09:25 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icmp6.c,v 1.67 2001/10/15 11:12:44 itojun Exp $        */
+/*     $NetBSD: icmp6.c,v 1.68 2001/10/18 09:09:25 itojun Exp $        */
 /*     $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
 
 /*
@@ -2471,7 +2471,6 @@
        struct nd_redirect *nd_rd;
        size_t maxlen;
        u_char *p;
-       struct ifnet *outif = NULL;
        struct sockaddr_in6 src_sa;
 
        icmp6_errcount(&icmp6stat.icp6s_outerrhist, ND_REDIRECT, 0);
@@ -2724,12 +2723,10 @@
 #ifdef IPSEC
        /* Don't lookup socket */
        (void)ipsec_setsocket(m, NULL);
-#endif /*IPSEC*/
-       ip6_output(m, NULL, NULL, 0, NULL, &outif);
-       if (outif) {
-               icmp6_ifstat_inc(outif, ifs6_out_msg);
-               icmp6_ifstat_inc(outif, ifs6_out_redirect);
-       }
+#endif /* IPSEC */
+       ip6_output(m, NULL, NULL, 0, NULL, NULL);
+       icmp6_ifstat_inc(ifp, ifs6_out_msg);
+       icmp6_ifstat_inc(ifp, ifs6_out_redirect);
        icmp6stat.icp6s_outhist[ND_REDIRECT]++;
 
        return;
diff -r fbd8f89d0e54 -r be363fac125e sys/netinet6/mld6.c
--- a/sys/netinet6/mld6.c       Thu Oct 18 08:03:46 2001 +0000
+++ b/sys/netinet6/mld6.c       Thu Oct 18 09:09:25 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mld6.c,v 1.14 2001/10/16 06:24:45 itojun Exp $ */
+/*     $NetBSD: mld6.c,v 1.15 2001/10/18 09:09:26 itojun Exp $ */
 /*     $KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $   */
 
 /*
@@ -383,7 +383,6 @@
        struct ip6_moptions im6o;
        struct in6_ifaddr *ia;
        struct ifnet *ifp = in6m->in6m_ifp;
-       struct ifnet *outif = NULL;
 
        /*
         * At first, find a link local address on the outgoing interface
@@ -453,19 +452,17 @@
        /* increment output statictics */
        icmp6stat.icp6s_outhist[type]++;
 
-       ip6_output(mh, &ip6_opts, NULL, 0, &im6o, &outif);
-       if (outif) {
-               icmp6_ifstat_inc(outif, ifs6_out_msg);
-               switch(type) {
-                case MLD6_LISTENER_QUERY:
-                        icmp6_ifstat_inc(outif, ifs6_out_mldquery);
-                        break;
-                case MLD6_LISTENER_REPORT:
-                        icmp6_ifstat_inc(outif, ifs6_out_mldreport);
-                        break;
-                case MLD6_LISTENER_DONE:
-                        icmp6_ifstat_inc(outif, ifs6_out_mlddone);
-                        break;
-               }
+       ip6_output(mh, &ip6_opts, NULL, 0, &im6o, NULL);
+       icmp6_ifstat_inc(ifp, ifs6_out_msg);
+       switch(type) {
+       case MLD6_LISTENER_QUERY:
+               icmp6_ifstat_inc(ifp, ifs6_out_mldquery);
+               break;
+       case MLD6_LISTENER_REPORT:
+               icmp6_ifstat_inc(ifp, ifs6_out_mldreport);
+               break;
+       case MLD6_LISTENER_DONE:
+               icmp6_ifstat_inc(ifp, ifs6_out_mlddone);
+               break;
        }
 }



Home | Main Index | Thread Index | Old Index