Staging: batman-adv: Count Ethernet header for incoming packets
authorSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Sat, 4 Sep 2010 23:58:21 +0000 (01:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 5 Sep 2010 07:29:43 +0000 (00:29 -0700)
The Ethernet header is counted when transmitting a packet, so it should also
be counted when receiving a packet. With this patch, the rx_bytes and tx_bytes
statistics behave like an ordinary Ethernet interface.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/soft-interface.c

index 2ea97de435ceab80b9c4838d66474bc064dbcb54..6f22e6ec05d89a4d45862f1e27cdb7638384e759 100644 (file)
@@ -259,7 +259,7 @@ void interface_rx(struct sk_buff *skb, int hdr_size)
         * PACKET_OTHERHOST or PACKET_HOST */
 
        priv->stats.rx_packets++;
-       priv->stats.rx_bytes += skb->len;
+       priv->stats.rx_bytes += skb->len + sizeof(struct ethhdr);
 
        dev->last_rx = jiffies;