DAT packets must be counted before any batadv_dat_snoop_incoming_* invocation otherwise the code flow can jump the counters increment at all
Signed-off-by: Antonio Quartulli ordex@autistici.org --- routing.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/routing.c b/routing.c index 12af7d3..75615cc 100644 --- a/routing.c +++ b/routing.c @@ -1061,6 +1061,10 @@ int batadv_recv_unicast_packet(struct sk_buff *skb,
/* packet for me */ if (batadv_is_my_mac(unicast_packet->dest)) { + if (is4addr) + batadv_dat_inc_counter(bat_priv, + unicast_4addr_packet->subtype); + if (batadv_dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size)) goto rx_success; @@ -1068,10 +1072,6 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, hdr_size)) goto rx_success;
- if (is4addr) - batadv_dat_inc_counter(bat_priv, - unicast_4addr_packet->subtype); - batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size, NULL);