Skip to content

Commit

Permalink
batman-adv: skip the window protection test when the originator has n…
Browse files Browse the repository at this point in the history
…o neighbours

When we receive an OGM from from a node for the first time, the last_real_seqno
field of the orig_node structure has not been initialised yet. The value of this
field is used to compute the current ogm-seqno window and therefore the
protection mechanism will probably drop the packet due to an out-of-window error.
To avoid this situation this patch adds a check to skip the window protection
mechanism if no neighbour nodes have already been added. When the first
neighbour node is added, the last_real_seqno field is initialised too.

Reported-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
  • Loading branch information
Antonio Quartulli committed Apr 18, 2012
1 parent c97c72b commit 1e5cc26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/batman-adv/bat_iv_ogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,8 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
seq_diff = batman_ogm_packet->seqno - orig_node->last_real_seqno;

/* signalize caller that the packet is to be dropped. */
if (window_protected(bat_priv, seq_diff,
if (!hlist_empty(&orig_node->neigh_list) &&
window_protected(bat_priv, seq_diff,
&orig_node->batman_seqno_reset))
goto out;

Expand Down

0 comments on commit 1e5cc26

Please sign in to comment.