From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <4F4A629F.4010004@hundeboll.net> Date: Sun, 26 Feb 2012 17:49:35 +0100 From: =?UTF-8?B?TWFydGluIEh1bmRlYsO4bGw=?= MIME-Version: 1.0 References: <1330267182-15607-1-git-send-email-ordex@autistici.org> <1330267182-15607-2-git-send-email-ordex@autistici.org> In-Reply-To: <1330267182-15607-2-git-send-email-ordex@autistici.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Subject: Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: skip the window protection test when the originator has no neighbours Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org On 02/26/2012 03:39 PM, Antonio Quartulli wrote: > 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 > Signed-off-by: Antonio Quartulli > --- > bat_iv_ogm.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c > index c42e030..d9195b3 100644 > --- a/bat_iv_ogm.c > +++ b/bat_iv_ogm.c > @@ -869,7 +869,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; > Tested this and originators now appear within 3 seconds after being added to the mesh network. Good work, Antonio and Marek! -- Kind regards, Martin Hundebøll Nordborggade 57, 2. 1 8000 Aarhus C +45 61 65 54 61 martin@hundeboll.net