Commit 32628a33 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Ben Hutchings

batman-adv: Fix rx packet/bytes stats on local ARP reply

commit 36d4d68c upstream.

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: c384ea3e ("batman-adv: Distributed ARP Table - add snooping functions for ARP messages")
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent ecca1170
...@@ -969,8 +969,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv, ...@@ -969,8 +969,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
skb_reset_mac_header(skb_new); skb_reset_mac_header(skb_new);
skb_new->protocol = eth_type_trans(skb_new, skb_new->protocol = eth_type_trans(skb_new,
bat_priv->soft_iface); bat_priv->soft_iface);
bat_priv->stats.rx_packets++; batadv_inc_counter(bat_priv, BATADV_CNT_RX);
bat_priv->stats.rx_bytes += skb->len + ETH_HLEN + hdr_size; batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,
skb->len + ETH_HLEN + hdr_size);
bat_priv->soft_iface->last_rx = jiffies; bat_priv->soft_iface->last_rx = jiffies;
netif_rx(skb_new); netif_rx(skb_new);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment