b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Fix rx packet/bytes stats on local ARP reply
@ 2017-04-05 14:26 Sven Eckelmann
  2017-05-19 10:41 ` Sven Eckelmann
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2017-04-05 14:26 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: a

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 <sven@narfation.org>
---
 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");
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fix rx packet/bytes stats on local ARP reply
  2017-04-05 14:26 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix rx packet/bytes stats on local ARP reply Sven Eckelmann
@ 2017-05-19 10:41 ` Sven Eckelmann
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Eckelmann @ 2017-05-19 10:41 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: a

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

On Mittwoch, 5. April 2017 16:26:17 CEST Sven Eckelmann wrote:
> 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 <sven@narfation.org>
> ---
>  net/batman-adv/distributed-arp-table.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Patch applied as 426ddde4ffe0c7345d1a7409bf899f89ddea26d3 [1]

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/426ddde4ffe0c7345d1a7409bf899f89ddea26d3

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-19 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 14:26 [B.A.T.M.A.N.] [PATCH] batman-adv: Fix rx packet/bytes stats on local ARP reply Sven Eckelmann
2017-05-19 10:41 ` Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).