Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 2014 10:19:51 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271863 - head/sys/netinet
Message-ID:  <201409191019.s8JAJpnn033866@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Sep 19 10:19:51 2014
New Revision: 271863
URL: http://svnweb.freebsd.org/changeset/base/271863

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/netinet/ip_gre.c

Modified: head/sys/netinet/ip_gre.c
==============================================================================
--- head/sys/netinet/ip_gre.c	Fri Sep 19 10:18:14 2014	(r271862)
+++ head/sys/netinet/ip_gre.c	Fri Sep 19 10:19:51 2014	(r271863)
@@ -142,8 +142,8 @@ gre_input2(struct mbuf *m ,int hlen, u_c
 	}
 	gip = mtod(m, struct greip *);
 
-	GRE2IFP(sc)->if_ipackets++;
-	GRE2IFP(sc)->if_ibytes += m->m_pkthdr.len;
+	if_inc_counter(GRE2IFP(sc), IFCOUNTER_IPACKETS, 1);
+	if_inc_counter(GRE2IFP(sc), IFCOUNTER_IBYTES, m->m_pkthdr.len);
 
 	switch (proto) {
 	case IPPROTO_GRE:
@@ -243,8 +243,8 @@ gre_mobile_input(struct mbuf **mp, int *
 	ip = mtod(m, struct ip *);
 	mip = mtod(m, struct mobip_h *);
 
-	GRE2IFP(sc)->if_ipackets++;
-	GRE2IFP(sc)->if_ibytes += m->m_pkthdr.len;
+	if_inc_counter(GRE2IFP(sc), IFCOUNTER_IPACKETS, 1);
+	if_inc_counter(GRE2IFP(sc), IFCOUNTER_IBYTES, m->m_pkthdr.len);
 
 	if (ntohs(mip->mh.proto) & MOB_H_SBIT) {
 		msiz = MOB_H_SIZ_L;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409191019.s8JAJpnn033866>