From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Marek Lindner Date: Thu, 16 Jul 2009 01:37:39 +0800 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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) 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: The list for a Better Approach To Mobile Ad-hoc Networking 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 */