From: Simon Wunderlich Date: Sat, 4 Sep 2010 23:58:21 +0000 (+0200) Subject: Staging: batman-adv: Count Ethernet header for incoming packets X-Git-Tag: firefly_0821_release~7613^2~3583^2~3^2~702 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=556c83ece8e8a897d7cad23315407ecd1a195fce;p=firefly-linux-kernel-4.4.55.git Staging: batman-adv: Count Ethernet header for incoming packets 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 Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/batman-adv/soft-interface.c b/drivers/staging/batman-adv/soft-interface.c index 2ea97de435ce..6f22e6ec05d8 100644 --- a/drivers/staging/batman-adv/soft-interface.c +++ b/drivers/staging/batman-adv/soft-interface.c @@ -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;