b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@ascom.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: "Linus Lüssing" <linus.luessing@ascom.ch>
Subject: [B.A.T.M.A.N.] [PATCH 1/2] batctl: Fix bisecting of OGMs with 32bit seqno
Date: Mon, 22 Nov 2010 22:45:53 +0100	[thread overview]
Message-ID: <1290462354-17246-1-git-send-email-linus.luessing@ascom.ch> (raw)

This patch increases the size of the seqno variable for bisect and now
uses UINT32_MAX for format checking. To be consistent, also "255"s got
substituted by UINT8_MAX

Signed-off-by: Linus Lüssing <linus.luessing@ascom.ch>
---
 bisect.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bisect.c b/bisect.c
index b7d8969..ee9e2f1 100644
--- a/bisect.c
+++ b/bisect.c
@@ -385,7 +385,7 @@ err:
 	return 0;
 }
 
-static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char *neigh, int seqno, int tq, int ttl)
+static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char *neigh, int64_t seqno, int tq, int ttl)
 {
 	struct bat_node *orig_node, *neigh_node, *prev_sender_node;
 	struct orig_event *orig_event;
@@ -406,17 +406,17 @@ static int seqno_event_new(char *iface_addr, char *orig, char *prev_sender, char
 		goto err;
 	}
 
-	if ((seqno < 0) || (seqno > 65535)) {
-		fprintf(stderr, "Invalid sequence number found (%i) - skipping", seqno);
+	if ((seqno < 0) || (seqno > UINT32_MAX)) {
+		fprintf(stderr, "Invalid sequence number found (%lli) - skipping", seqno);
 		goto err;
 	}
 
-	if ((tq < 0) || (tq > 255)) {
+	if ((tq < 0) || (tq > UINT8_MAX)) {
 		fprintf(stderr, "Invalid tq value found (%i) - skipping", tq);
 		goto err;
 	}
 
-	if ((ttl < 0) || (ttl > 255)) {
+	if ((ttl < 0) || (ttl > UINT8_MAX)) {
 		fprintf(stderr, "Invalid ttl value found (%i) - skipping", ttl);
 		goto err;
 	}
-- 
1.7.1


             reply	other threads:[~2010-11-22 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 21:45 Linus Lüssing [this message]
2010-11-22 21:45 ` [B.A.T.M.A.N.] [PATCH 2/2] batctl: Fix (skipped) substitutions of mac addresses Linus Lüssing
2010-11-22 23:48   ` Marek Lindner
2010-11-22 21:46 ` [B.A.T.M.A.N.] [PATCH 1/2] batctl: Fix bisecting of OGMs with 32bitseqno slnxumalo
2010-11-22 23:44 ` [B.A.T.M.A.N.] [PATCH 1/2] batctl: Fix bisecting of OGMs with 32bit seqno Marek Lindner
2010-11-23  9:50   ` Linus Lüssing
2010-11-23 12:13   ` [B.A.T.M.A.N.] batctl bisect fixes, 2nd version Linus Lüssing
2010-11-28 16:15     ` Marek Lindner
2010-11-23 12:13   ` [B.A.T.M.A.N.] [PATCHv2 1/3] batctl: Fix bisecting of OGMs with 32bit seqno Linus Lüssing
2010-11-23 12:13   ` [B.A.T.M.A.N.] [PATCHv2 2/3] batctl: Fix skipped substitutions of mac addresses with a following ', ' Linus Lüssing
2010-11-23 12:13   ` [B.A.T.M.A.N.] [PATCHv2 3/3] batctl: Fix substitution of mac addresses with a following ')' Linus Lüssing

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=1290462354-17246-1-git-send-email-linus.luessing@ascom.ch \
    --to=linus.luessing@ascom.ch \
    --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;
as well as URLs for NNTP newsgroup(s).