public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@web.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Fixing wrap-around bug in vis
Date: Thu, 11 Mar 2010 22:41:36 +0100	[thread overview]
Message-ID: <20100311214136.GA13625@Linus-Debian> (raw)
In-Reply-To: <1268342346-13713-1-git-send-email-linus.luessing@web.de>

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

Sorry, typo there, has to be ">=" and not "<=" of coures. My
fault.

On Thu, Mar 11, 2010 at 10:19:06PM +0100, Linus Lüssing wrote:
> When the seqno for a vis packet had a wrap around from i.e. 255 to 0,
> add_packet() would falsely claim the older packet with the seqno 255 as
> newer as the one with the seqno of 0 and would therefore ignore the new
> packet. This happens with all following vis packets until the old vis
> packet expires after 180 seconds timeout. This patch fixes this issue
> and gets rid of these highly undesired 3min. breaks for the vis-server.
> 
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
>  batman-adv-kernelland/vis.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/batman-adv-kernelland/vis.c b/batman-adv-kernelland/vis.c
> index fa8a487..5735a6a 100644
> --- a/batman-adv-kernelland/vis.c
> +++ b/batman-adv-kernelland/vis.c
> @@ -213,7 +213,8 @@ static struct vis_info *add_packet(struct vis_packet *vis_packet,
>  	old_info = hash_find(vis_hash, &search_elem);
>  
>  	if (old_info != NULL) {
> -		if (vis_packet->seqno - old_info->packet.seqno <= 0) {
> +		if (vis_packet->seqno - old_info->packet.seqno
> +		    <= 1 << 7 * sizeof(vis_packet->seqno)) {
>  			if (old_info->packet.seqno == vis_packet->seqno) {
>  				recv_list_add(&old_info->recv_list,
>  					      vis_packet->sender_orig);
> -- 
> 1.7.0
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2010-03-11 21:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 23:03 [B.A.T.M.A.N.] vis: (sometimes) missing entries Linus Lüssing
2010-03-11 16:38 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fixing wrap-around bug in vis Linus Lüssing
2010-03-11 17:14   ` Linus Lüssing
2010-03-11 21:19   ` Linus Lüssing
2010-03-11 21:41     ` Linus Lüssing [this message]
2010-03-11 22:06     ` Sven Eckelmann
2010-03-11 22:33       ` Sven Eckelmann
2010-03-11 23:04         ` Sven Eckelmann
2010-03-12  0:09           ` Linus Lüssing
2010-03-12  7:45             ` Andrew Lunn
2010-03-12  9:04             ` Sven Eckelmann
2010-03-12 15:16               ` Sven Eckelmann
2010-03-12 19:09                 ` Sven Eckelmann
2010-03-14 15:46                   ` Linus Lüssing
2010-03-14 17:51                     ` Marek Lindner
2010-03-12 20:57       ` Simon Wunderlich
2010-03-12 21:06         ` Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100311214136.GA13625@Linus-Debian \
    --to=linus.luessing@web.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox