From patchwork Mon Nov 22 21:46:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: slnxumalo@gmail.com X-Patchwork-Id: 593 Return-Path: Received: from mail-ew0-f41.google.com (mail-ew0-f41.google.com [209.85.215.41]) by open-mesh.org (Postfix) with ESMTP id 647FE154597 for ; Mon, 22 Nov 2010 22:49:42 +0100 (CET) Received: by ewy21 with SMTP id 21so83152ewy.14 for ; Mon, 22 Nov 2010 13:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:x-rim-org-msg-ref-id :message-id:content-transfer-encoding:reply-to:x-priority:references :in-reply-to:sensitivity:importance:subject:to:from:date :content-type:mime-version; bh=3FSnkOS9QNe/EoX393jNvuKeoUSfK2dgb8O/E4EmKNw=; b=VvrKLO+uqpLapR8M+rUGcqtUQkW79VDElW5LnOUD/ncTy1pVx215JN6EFiiKvzIyjM elxbdE8wsh2yZicZ73CzjgraOf+SwXBG6LZpOBYWR+KUP7o8oeh8UCKKuJOlQZAoFy3m eT6HSvY6Rj+khC+JCoGlK+xfN5Fq95BcItgFc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=x-rim-org-msg-ref-id:message-id:content-transfer-encoding:reply-to :x-priority:references:in-reply-to:sensitivity:importance:subject:to :from:date:content-type:mime-version; b=cyD7pQdLap0IsayIQ7fru3oL9nX4hU+Ex2jHILhOHOLvbwkoc5+DvT/9g3Wvy7FziV 1M/BWSCkD8ZdBJ6F3JRv3ULmNtydjFctGnCIY58Lp/KB/SOrLM240UFYUujUIpd8jjZy YH5KzyEAaSkoa8e44l9p+D/mYQTkBLHWXlM3w= Received: by 10.213.21.203 with SMTP id k11mr5356261ebb.88.1290462581249; Mon, 22 Nov 2010 13:49:41 -0800 (PST) Received: from ups8.c11.bise7.blackberry (bda-178-239-85-57.bis7.eu.blackberry.com [178.239.85.57]) by mx.google.com with ESMTPS id v51sm5068824eeh.16.2010.11.22.13.49.35 (version=SSLv3 cipher=RC4-MD5); Mon, 22 Nov 2010 13:49:35 -0800 (PST) X-rim-org-msg-ref-id: 1215065789 Message-ID: <1215065789-1290462574-cardhu_decombobulator_blackberry.rim.net-971802515-@b27.c11.bise7.blackberry> X-Priority: Normal References: <1290462354-17246-1-git-send-email-linus.luessing@ascom.ch> In-Reply-To: <1290462354-17246-1-git-send-email-linus.luessing@ascom.ch> Sensitivity: Normal Importance: Normal To: "The list for a Better Approach To Mobile Ad-hoc Networking" From: slnxumalo@gmail.com Date: Mon, 22 Nov 2010 21:46:18 +0000 MIME-Version: 1.0 Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batctl: Fix bisecting of OGMs with 32bitseqno X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: slnxumalo@gmail.com, 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: , X-List-Received-Date: Mon, 22 Nov 2010 21:49:42 -0000 I would like to unsubscribe from this forum. Sent via my BlackBerry from Vodacom - let your email find you! -----Original Message----- From: Linus Lüssing Sender: b.a.t.m.a.n-bounces@lists.open-mesh.org Date: Mon, 22 Nov 2010 22:45:53 To: Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Cc: Linus Lüssing Subject: [B.A.T.M.A.N.] [PATCH 1/2] batctl: Fix bisecting of OGMs with 32bit seqno 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 --- bisect.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) -- 1.7.1 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; }