summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/originator.c
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2015-03-01 00:50:17 +0800
committerAntonio Quartulli <antonio@meshcoding.com>2015-06-07 17:07:18 +0200
commitbcef1f3c49daee2829cf58e30310427c63038cff (patch)
treee5be48bf313b97c3cdc98e54b47b9f50a9f1f487 /net/batman-adv/originator.c
parent6f70eb7552abc73584f43b701d71c1c377887af0 (diff)
downloadop-kernel-dev-bcef1f3c49daee2829cf58e30310427c63038cff.zip
op-kernel-dev-bcef1f3c49daee2829cf58e30310427c63038cff.tar.gz
batman-adv: add bat_neigh_free API
This API has to be used to let any routing protocol free neighbor specific allocated resources Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r--net/batman-adv/originator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index e3900e4..aa092c3 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -197,13 +197,19 @@ static void batadv_neigh_node_free_rcu(struct rcu_head *rcu)
struct hlist_node *node_tmp;
struct batadv_neigh_node *neigh_node;
struct batadv_neigh_ifinfo *neigh_ifinfo;
+ struct batadv_algo_ops *bao;
neigh_node = container_of(rcu, struct batadv_neigh_node, rcu);
+ bao = neigh_node->orig_node->bat_priv->bat_algo_ops;
hlist_for_each_entry_safe(neigh_ifinfo, node_tmp,
&neigh_node->ifinfo_list, list) {
batadv_neigh_ifinfo_free_ref_now(neigh_ifinfo);
}
+
+ if (bao->bat_neigh_free)
+ bao->bat_neigh_free(neigh_node);
+
batadv_hardif_free_ref_now(neigh_node->if_incoming);
kfree(neigh_node);
OpenPOWER on IntegriCloud