From patchwork Wed Jul 15 17:37:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 5115 Return-Path: Received: from mo-p05-ob.rzone.de (mo-p05-ob.rzone.de [81.169.146.182]) by open-mesh.net (Postfix) with ESMTP id 4646A154390 for ; Wed, 15 Jul 2009 18:02:52 +0000 (UTC) X-RZG-AUTH: :OGkHfVO9a++ASa1NN1xF8Z+yxAO4YqHmxoKm7X00LncCjhL5i1Yt3al3Gv4UR4pxi2RPNNa4 X-RZG-CLASS-ID: mo05 Received: from turgot.localnet (61-59-128-157.static.seed.net.tw [61.59.128.157]) by post.strato.de (fruni mo23) (RZmta 18.49) with ESMTP id I02cb3l6FGXKmE for ; Wed, 15 Jul 2009 19:38:59 +0200 (MEST) From: Marek Lindner To: "The list for a Better Approach To Mobile Ad-hoc Networking" Date: Thu, 16 Jul 2009 01:37:39 +0800 User-Agent: KMail/1.11.4 (Linux/2.6.30-1-686; KDE/4.2.4; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907160137.39536.lindner_marek@yahoo.de> Subject: [B.A.T.M.A.N.] [vis] Remove duplicate routes from vis output (revised) X-BeenThere: b.a.t.m.a.n@lists.open-mesh.net X-Mailman-Version: 2.1.11 Precedence: list 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: , X-List-Received-Date: Wed, 15 Jul 2009 18:02:52 -0000 Revision 1271 introduced a bug on the call to hash->compare() that caused duplicate routes to appear in the vis output. Adapting the hash->compare() callback fixes the problem. Signed-off-by: Edwe Cowley Signed-off-by: Marek Lindner Index: vis/vis.c =================================================================== --- vis/vis.c (revision 1343) +++ vis/vis.c (working copy) @@ -119,8 +119,9 @@ return stop != 0; } -int32_t orig_comp(void *data1, void *data2) { - return(memcmp(data1, data2, 4)); +int32_t orig_comp(void *data1, void *data2) +{ + return (memcmp(data1, data2, 4) == 0 ? 1 : 0); } /* hashfunction to choose an entry in a hash table of given size */