aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-02-26 09:39:42 -0500
committerAntonio Quartulli <ordex@autistici.org>2012-04-18 03:54:02 -0400
commit1e5cc266dbc401d11aefb966ad35e651c2f67414 (patch)
treefd920a0dca939ae719066941445cb87d8284969f /net/batman-adv/bat_iv_ogm.c
parentc97c72b493d7b450005f4054b15679e312c89caa (diff)
batman-adv: skip the window protection test when the originator has no 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>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 1014210bb365..8b2db2e76c7e 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -861,7 +861,8 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
861 seq_diff = batman_ogm_packet->seqno - orig_node->last_real_seqno; 861 seq_diff = batman_ogm_packet->seqno - orig_node->last_real_seqno;
862 862
863 /* signalize caller that the packet is to be dropped. */ 863 /* signalize caller that the packet is to be dropped. */
864 if (window_protected(bat_priv, seq_diff, 864 if (!hlist_empty(&orig_node->neigh_list) &&
865 window_protected(bat_priv, seq_diff,
865 &orig_node->batman_seqno_reset)) 866 &orig_node->batman_seqno_reset))
866 goto out; 867 goto out;
867 868