aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/routing.c
diff options
context:
space:
mode:
authorMartin Hundebøll <martin@hundeboll.net>2012-04-20 11:02:45 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-11-07 14:00:23 -0500
commit4046b24aface62f5647699e9af3260a486bc5f49 (patch)
tree82e7fe03be17690b109fb3fff82e83fb63ef28cd /net/batman-adv/routing.c
parent33af49ad8ae44de52c0ac30b1a9707dad5e4c418 (diff)
batman-adv: Add get_ethtool_stats() support for DAT
Added additional counters for D.A.T. Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r--net/batman-adv/routing.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 1826699314b7..3f21c0905dde 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -985,15 +985,17 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
985{ 985{
986 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface); 986 struct batadv_priv *bat_priv = netdev_priv(recv_if->soft_iface);
987 struct batadv_unicast_packet *unicast_packet; 987 struct batadv_unicast_packet *unicast_packet;
988 struct batadv_unicast_4addr_packet *unicast_4addr_packet;
988 int hdr_size = sizeof(*unicast_packet); 989 int hdr_size = sizeof(*unicast_packet);
989 bool is4addr; 990 bool is4addr;
990 991
991 unicast_packet = (struct batadv_unicast_packet *)skb->data; 992 unicast_packet = (struct batadv_unicast_packet *)skb->data;
993 unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data;
992 994
993 is4addr = unicast_packet->header.packet_type == BATADV_UNICAST_4ADDR; 995 is4addr = unicast_packet->header.packet_type == BATADV_UNICAST_4ADDR;
994 /* the caller function should have already pulled 2 bytes */ 996 /* the caller function should have already pulled 2 bytes */
995 if (is4addr) 997 if (is4addr)
996 hdr_size = sizeof(struct batadv_unicast_4addr_packet); 998 hdr_size = sizeof(*unicast_4addr_packet);
997 999
998 if (batadv_check_unicast_packet(skb, hdr_size) < 0) 1000 if (batadv_check_unicast_packet(skb, hdr_size) < 0)
999 return NET_RX_DROP; 1001 return NET_RX_DROP;
@@ -1003,6 +1005,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
1003 1005
1004 /* packet for me */ 1006 /* packet for me */
1005 if (batadv_is_my_mac(unicast_packet->dest)) { 1007 if (batadv_is_my_mac(unicast_packet->dest)) {
1008 if (is4addr)
1009 batadv_dat_inc_counter(bat_priv,
1010 unicast_4addr_packet->subtype);
1011
1006 if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, 1012 if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb,
1007 hdr_size)) 1013 hdr_size))
1008 goto rx_success; 1014 goto rx_success;