Author: marek Date: 2010-07-22 17:31:59 +0200 (Thu, 22 Jul 2010) New Revision: 1739
Modified: trunk/batman-adv/compat.h trunk/batman-adv/hard-interface.c Log: batman-adv: Don't increment stats of foreign device
The receive hook for batman-adv ethernet frames tried to get the last device which processed the skb before us. It only used that information to update the rx_bytes and rx_packets stat of that foreign device which already has updated it using its own receive functions.
Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
Modified: trunk/batman-adv/compat.h =================================================================== --- trunk/batman-adv/compat.h 2010-07-11 17:42:17 UTC (rev 1738) +++ trunk/batman-adv/compat.h 2010-07-22 15:31:59 UTC (rev 1739) @@ -249,12 +249,4 @@
#endif /* < KERNEL_VERSION(2, 6, 29) */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) - -#define dev_get_stats(x, y) dev_get_stats(x) - -#define rtnl_link_stats64 rtnl_link_stats __attribute__((unused)) - -#endif /* < KERNEL_VERSION(2, 6, 36) */ - #endif /* _NET_BATMAN_ADV_COMPAT_H_ */
Modified: trunk/batman-adv/hard-interface.c =================================================================== --- trunk/batman-adv/hard-interface.c 2010-07-11 17:42:17 UTC (rev 1738) +++ trunk/batman-adv/hard-interface.c 2010-07-22 15:31:59 UTC (rev 1739) @@ -471,8 +471,6 @@ struct bat_priv *bat_priv = netdev_priv(soft_device); struct batman_packet *batman_packet; struct batman_if *batman_if; - struct net_device_stats *stats; - struct rtnl_link_stats64 temp; int ret;
skb = skb_share_check(skb, GFP_ATOMIC); @@ -508,12 +506,6 @@ if (batman_if->if_status != IF_ACTIVE) goto err_free;
- stats = (struct net_device_stats *)dev_get_stats(skb->dev, &temp); - if (stats) { - stats->rx_packets++; - stats->rx_bytes += skb->len; - } - batman_packet = (struct batman_packet *)skb->data;
if (batman_packet->version != COMPAT_VERSION) {