public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: fix DAT packet counting
@ 2012-10-09 13:00 Antonio Quartulli
  2012-10-14 14:54 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-10-09 13:00 UTC (permalink / raw)
  To: b.a.t.m.a.n

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);
 
-- 
1.7.12


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: fix DAT packet counting
  2012-10-09 13:00 [B.A.T.M.A.N.] [PATCH] batman-adv: fix DAT packet counting Antonio Quartulli
@ 2012-10-14 14:54 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2012-10-14 14:54 UTC (permalink / raw)
  To: b.a.t.m.a.n

On Tuesday, October 09, 2012 21:00:11 Antonio Quartulli wrote:
> 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(-)

Applied in revision 2b105ca.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-14 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 13:00 [B.A.T.M.A.N.] [PATCH] batman-adv: fix DAT packet counting Antonio Quartulli
2012-10-14 14:54 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox