Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / net / batman-adv / originator.c
index 96fb80b724dc28ec01701edcb2e85a21a2d3d5b5..2f3452546636ce71747ef9a8b1a949caae8d8f04 100644 (file)
@@ -28,6 +28,7 @@
 #include "unicast.h"
 #include "soft-interface.h"
 #include "bridge_loop_avoidance.h"
+#include "network-coding.h"
 
 /* hash class keys */
 static struct lock_class_key batadv_orig_hash_lock_class_key;
@@ -142,6 +143,9 @@ static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
 
        spin_unlock_bh(&orig_node->neigh_list_lock);
 
+       /* Free nc_nodes */
+       batadv_nc_purge_orig(orig_node->bat_priv, orig_node, NULL);
+
        batadv_frag_list_free(&orig_node->frag_list);
        batadv_tt_global_del_orig(orig_node->bat_priv, orig_node,
                                  "originator timed out");
@@ -219,6 +223,8 @@ struct batadv_orig_node *batadv_get_orig_node(struct batadv_priv *bat_priv,
        spin_lock_init(&orig_node->neigh_list_lock);
        spin_lock_init(&orig_node->tt_buff_lock);
 
+       batadv_nc_init_orig(orig_node);
+
        /* extra reference for return */
        atomic_set(&orig_node->refcount, 2);
 
@@ -459,7 +465,7 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
                                           neigh_node_tmp->tq_avg);
                        }
 
-                       seq_printf(seq, "\n");
+                       seq_puts(seq, "\n");
                        batman_count++;
 
 next:
@@ -469,7 +475,7 @@ next:
        }
 
        if (batman_count == 0)
-               seq_printf(seq, "No batman nodes in range ...\n");
+               seq_puts(seq, "No batman nodes in range ...\n");
 
 out:
        if (primary_if)