From patchwork Sat May 5 15:51:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 1858 Return-Path: Received: from bear.g4t3.de (h1760320.stratoserver.net [85.214.77.231]) by open-mesh.org (Postfix) with ESMTP id 0DC06600411 for ; Sat, 5 May 2012 17:51:59 +0200 (CEST) Received: from chaos.universe-factory.net (chaos.universe-factory.net [193.34.68.222]) by bear.g4t3.de (Postfix) with ESMTP id 22124459BE for ; Sat, 5 May 2012 17:58:02 +0200 (CEST) Received: from localhost.localdomain (unknown [89.244.79.35]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by chaos.universe-factory.net (Postfix) with ESMTPSA id 6A3B1C656F for ; Sat, 5 May 2012 15:51:58 +0000 (UTC) From: Matthias Schiffer To: b.a.t.m.a.n@lists.open-mesh.org Date: Sat, 5 May 2012 17:51:53 +0200 Message-Id: <7f84c7e913b9a0c9a22cc19864c6b7d9e2a347de.1336233103.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <4FA54C09.6000303@universe-factory.net> References: <4FA54C09.6000303@universe-factory.net> Subject: [B.A.T.M.A.N.] [PATCHv2] batman-adv: fix visualization output without neighbors on the primary interface X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 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: Sat, 05 May 2012 15:51:59 -0000 The primary entry and the corresponding secondary entries are missing when there are no neighbors on the primary interface. This also causes the TT entries to miss and makes nodes with multiply secondary interface fall apart since there is no way to see they are related without a primary entry. Fix this by always emitting a primary entry. Signed-off-by: Matthias Schiffer Acked-by: Simon Wunderlich --- vis.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/vis.c b/vis.c index cec216f..c515927 100644 --- a/vis.c +++ b/vis.c @@ -207,7 +207,6 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) int vis_server = atomic_read(&bat_priv->vis_mode); size_t buff_pos, buf_size; char *buff; - int compare; primary_if = primary_if_get_selected(bat_priv); if (!primary_if) @@ -228,14 +227,18 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) entries = (struct vis_info_entry *) ((char *)packet + sizeof(*packet)); + vis_data_insert_interface(packet->vis_orig, + &vis_if_list, true); + for (j = 0; j < packet->entries; j++) { if (entries[j].quality == 0) continue; - compare = - compare_eth(entries[j].src, packet->vis_orig); + if (compare_eth(entries[j].src, + packet->vis_orig)) + continue; vis_data_insert_interface(entries[j].src, &vis_if_list, - compare); + false); } hlist_for_each_entry(entry, pos, &vis_if_list, list) { @@ -276,14 +279,18 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) entries = (struct vis_info_entry *) ((char *)packet + sizeof(*packet)); + vis_data_insert_interface(packet->vis_orig, + &vis_if_list, true); + for (j = 0; j < packet->entries; j++) { if (entries[j].quality == 0) continue; - compare = - compare_eth(entries[j].src, packet->vis_orig); + if (compare_eth(entries[j].src, + packet->vis_orig)) + continue; vis_data_insert_interface(entries[j].src, &vis_if_list, - compare); + false); } hlist_for_each_entry(entry, pos, &vis_if_list, list) {