batman-adv: Add get_ethtool_stats() support
[deliverable/linux.git] / net / batman-adv / bat_iv_ogm.c
index ec351199c652aa3f8eaaa4b4086031fd9b005349..99ec218df7f21e225b08879ebe989e23ed7e7929 100644 (file)
@@ -196,8 +196,12 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
 
        /* create clone because function is called more than once */
        skb = skb_clone(forw_packet->skb, GFP_ATOMIC);
-       if (skb)
+       if (skb) {
+               batadv_inc_counter(bat_priv, BAT_CNT_MGMT_TX);
+               batadv_add_counter(bat_priv, BAT_CNT_MGMT_TX_BYTES,
+                                  skb->len + ETH_HLEN);
                send_skb_packet(skb, hard_iface, broadcast_addr);
+       }
 }
 
 /* send a batman ogm packet */
@@ -1203,6 +1207,10 @@ static int bat_iv_ogm_receive(struct sk_buff *skb,
        if (bat_priv->bat_algo_ops->bat_ogm_emit != bat_iv_ogm_emit)
                return NET_RX_DROP;
 
+       batadv_inc_counter(bat_priv, BAT_CNT_MGMT_RX);
+       batadv_add_counter(bat_priv, BAT_CNT_MGMT_RX_BYTES,
+                          skb->len + ETH_HLEN);
+
        packet_len = skb_headlen(skb);
        ethhdr = (struct ethhdr *)skb_mac_header(skb);
        packet_buff = skb->data;
This page took 0.045144 seconds and 5 git commands to generate.