From patchwork Wed Apr 5 14:26:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16988 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 5C83C83718; Wed, 5 Apr 2017 16:26:52 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=P13VmIYj; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id A21EE83717 for ; Wed, 5 Apr 2017 16:26:47 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p2003007C6F63E7FE527B9DFFFECE2683.dip0.t-ipconnect.de [IPv6:2003:7c:6f63:e7fe:527b:9dff:fece:2683]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 34B161100D8; Wed, 5 Apr 2017 16:26:47 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1491402407; bh=wbQo78QjfB6jNdb66iEs3GKNX1trNw6f7eePEwSueEc=; h=From:To:Cc:Subject:Date:From; b=P13VmIYjpk5Oo3ZH7XDAQLiSm83WrqCqHElujB75pWc9UdyG+qp8e14ZH+HHtEJJX fb7GOvDRb3oVKpFcBlhG36bYRNjrX7jwoiWeCt0tizcV+HELofk8tdB+kKTiH9sB7O 2WwzNNNZOByr8LfPTDspCsbbPComDXAVB2vP4igw= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 5 Apr 2017 16:26:17 +0200 Message-Id: <20170405142617.21758-1-sven@narfation.org> X-Mailer: git-send-email 2.11.0 Cc: a@unstable.cc Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix rx packet/bytes stats on local ARP reply X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The stats are generated by batadv_interface_stats and must not be stored directly in the net_device stats member variable. The batadv_priv bat_counters information is assembled when ndo_get_stats is called. The stats previously stored in net_device::stats is then overwritten. The batman-adv counters must therefore be increased when an ARP packet is answered locally via the distributed arp table. Fixes: 75ca71d858f5 ("batman-adv: Distributed ARP Table - add snooping functions for ARP messages") Signed-off-by: Sven Eckelmann --- net/batman-adv/distributed-arp-table.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) This patch is only compile tested. diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index 013e970..000ca2f 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -1064,8 +1064,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, skb_new->protocol = eth_type_trans(skb_new, soft_iface); - soft_iface->stats.rx_packets++; - soft_iface->stats.rx_bytes += skb->len + ETH_HLEN + hdr_size; + batadv_inc_counter(bat_priv, BATADV_CNT_RX); + batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, + skb->len + ETH_HLEN + hdr_size); netif_rx(skb_new); batadv_dbg(BATADV_DBG_DAT, bat_priv, "ARP request replied locally\n");