batman-adv: do not print orig nodes without nc neighbors on nc table print

Message ID 1366232163-26251-1-git-send-email-lindner_marek@yahoo.de (mailing list archive)
State Accepted, archived
Commit 7b6b29ff35458c2bda9a0055f8535a2246296ccd
Headers

Commit Message

Marek Lindner April 17, 2013, 8:56 p.m. UTC
  Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 network-coding.c |    7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Marek Lindner April 19, 2013, 11:47 a.m. UTC | #1
On Thursday, April 18, 2013 04:56:03 Marek Lindner wrote:
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> ---
>  network-coding.c |    7 +++++++
>  1 file changed, 7 insertions(+)

Applied in revision 7b6b29f.

Regards,
Marek
  

Patch

diff --git a/network-coding.c b/network-coding.c
index c93df9e..b1c733a 100644
--- a/network-coding.c
+++ b/network-coding.c
@@ -1760,6 +1760,13 @@  int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset)
 		/* For each orig_node in this bin */
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
+			/* no need to print the orig node if it does not have
+			 * network coding neighbors
+			 */
+			if (list_empty(&orig_node->in_coding_list) &&
+			    list_empty(&orig_node->out_coding_list))
+				continue;
+
 			seq_printf(seq, "Node:      %pM\n", orig_node->orig);
 
 			seq_puts(seq, " Ingoing:  ");