aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/batman-adv/bat_debugfs.c2
-rw-r--r--net/batman-adv/bat_iv_ogm.c43
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c4
-rw-r--r--net/batman-adv/gateway_client.c28
-rw-r--r--net/batman-adv/hard-interface.c6
-rw-r--r--net/batman-adv/icmp_socket.c6
-rw-r--r--net/batman-adv/main.c4
-rw-r--r--net/batman-adv/originator.c35
-rw-r--r--net/batman-adv/originator.h21
-rw-r--r--net/batman-adv/routing.c58
-rw-r--r--net/batman-adv/translation-table.c32
-rw-r--r--net/batman-adv/unicast.c6
-rw-r--r--net/batman-adv/vis.c20
13 files changed, 134 insertions, 131 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c
index 9177a0619906..51b67f4a064b 100644
--- a/net/batman-adv/bat_debugfs.c
+++ b/net/batman-adv/bat_debugfs.c
@@ -230,7 +230,7 @@ static int bat_algorithms_open(struct inode *inode, struct file *file)
230static int originators_open(struct inode *inode, struct file *file) 230static int originators_open(struct inode *inode, struct file *file)
231{ 231{
232 struct net_device *net_dev = (struct net_device *)inode->i_private; 232 struct net_device *net_dev = (struct net_device *)inode->i_private;
233 return single_open(file, orig_seq_print_text, net_dev); 233 return single_open(file, batadv_orig_seq_print_text, net_dev);
234} 234}
235 235
236static int gateways_open(struct inode *inode, struct file *file) 236static int gateways_open(struct inode *inode, struct file *file)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index defcac1184c4..9c8c9d017d00 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -633,7 +633,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
633 (tmp_neigh_node->if_incoming == if_incoming) && 633 (tmp_neigh_node->if_incoming == if_incoming) &&
634 atomic_inc_not_zero(&tmp_neigh_node->refcount)) { 634 atomic_inc_not_zero(&tmp_neigh_node->refcount)) {
635 if (neigh_node) 635 if (neigh_node)
636 neigh_node_free_ref(neigh_node); 636 batadv_neigh_node_free_ref(neigh_node);
637 neigh_node = tmp_neigh_node; 637 neigh_node = tmp_neigh_node;
638 continue; 638 continue;
639 } 639 }
@@ -652,7 +652,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
652 if (!neigh_node) { 652 if (!neigh_node) {
653 struct orig_node *orig_tmp; 653 struct orig_node *orig_tmp;
654 654
655 orig_tmp = get_orig_node(bat_priv, ethhdr->h_source); 655 orig_tmp = batadv_get_orig_node(bat_priv, ethhdr->h_source);
656 if (!orig_tmp) 656 if (!orig_tmp)
657 goto unlock; 657 goto unlock;
658 658
@@ -660,7 +660,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
660 orig_node, orig_tmp, 660 orig_node, orig_tmp,
661 batman_ogm_packet->seqno); 661 batman_ogm_packet->seqno);
662 662
663 orig_node_free_ref(orig_tmp); 663 batadv_orig_node_free_ref(orig_tmp);
664 if (!neigh_node) 664 if (!neigh_node)
665 goto unlock; 665 goto unlock;
666 } else 666 } else
@@ -688,7 +688,7 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
688 688
689 /* if this neighbor already is our next hop there is nothing 689 /* if this neighbor already is our next hop there is nothing
690 * to change */ 690 * to change */
691 router = orig_node_get_router(orig_node); 691 router = batadv_orig_node_get_router(orig_node);
692 if (router == neigh_node) 692 if (router == neigh_node)
693 goto update_tt; 693 goto update_tt;
694 694
@@ -746,9 +746,9 @@ unlock:
746 rcu_read_unlock(); 746 rcu_read_unlock();
747out: 747out:
748 if (neigh_node) 748 if (neigh_node)
749 neigh_node_free_ref(neigh_node); 749 batadv_neigh_node_free_ref(neigh_node);
750 if (router) 750 if (router)
751 neigh_node_free_ref(router); 751 batadv_neigh_node_free_ref(router);
752} 752}
753 753
754static int bat_iv_ogm_calc_tq(struct orig_node *orig_node, 754static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
@@ -848,7 +848,7 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
848 848
849out: 849out:
850 if (neigh_node) 850 if (neigh_node)
851 neigh_node_free_ref(neigh_node); 851 batadv_neigh_node_free_ref(neigh_node);
852 return ret; 852 return ret;
853} 853}
854 854
@@ -875,7 +875,7 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
875 int set_mark, ret = -1; 875 int set_mark, ret = -1;
876 uint32_t seqno = ntohl(batman_ogm_packet->seqno); 876 uint32_t seqno = ntohl(batman_ogm_packet->seqno);
877 877
878 orig_node = get_orig_node(bat_priv, batman_ogm_packet->orig); 878 orig_node = batadv_get_orig_node(bat_priv, batman_ogm_packet->orig);
879 if (!orig_node) 879 if (!orig_node)
880 return 0; 880 return 0;
881 881
@@ -924,7 +924,7 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
924 924
925out: 925out:
926 spin_unlock_bh(&orig_node->ogm_cnt_lock); 926 spin_unlock_bh(&orig_node->ogm_cnt_lock);
927 orig_node_free_ref(orig_node); 927 batadv_orig_node_free_ref(orig_node);
928 return ret; 928 return ret;
929} 929}
930 930
@@ -1029,7 +1029,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1029 unsigned long *word; 1029 unsigned long *word;
1030 int offset; 1030 int offset;
1031 1031
1032 orig_neigh_node = get_orig_node(bat_priv, ethhdr->h_source); 1032 orig_neigh_node = batadv_get_orig_node(bat_priv,
1033 ethhdr->h_source);
1033 if (!orig_neigh_node) 1034 if (!orig_neigh_node)
1034 return; 1035 return;
1035 1036
@@ -1053,7 +1054,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1053 1054
1054 bat_dbg(DBG_BATMAN, bat_priv, 1055 bat_dbg(DBG_BATMAN, bat_priv,
1055 "Drop packet: originator packet from myself (via neighbor)\n"); 1056 "Drop packet: originator packet from myself (via neighbor)\n");
1056 orig_node_free_ref(orig_neigh_node); 1057 batadv_orig_node_free_ref(orig_neigh_node);
1057 return; 1058 return;
1058 } 1059 }
1059 1060
@@ -1071,7 +1072,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1071 return; 1072 return;
1072 } 1073 }
1073 1074
1074 orig_node = get_orig_node(bat_priv, batman_ogm_packet->orig); 1075 orig_node = batadv_get_orig_node(bat_priv, batman_ogm_packet->orig);
1075 if (!orig_node) 1076 if (!orig_node)
1076 return; 1077 return;
1077 1078
@@ -1091,9 +1092,9 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1091 goto out; 1092 goto out;
1092 } 1093 }
1093 1094
1094 router = orig_node_get_router(orig_node); 1095 router = batadv_orig_node_get_router(orig_node);
1095 if (router) 1096 if (router)
1096 router_router = orig_node_get_router(router->orig_node); 1097 router_router = batadv_orig_node_get_router(router->orig_node);
1097 1098
1098 if ((router && router->tq_avg != 0) && 1099 if ((router && router->tq_avg != 0) &&
1099 (compare_eth(router->addr, ethhdr->h_source))) 1100 (compare_eth(router->addr, ethhdr->h_source)))
@@ -1115,11 +1116,11 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1115 * originator mac */ 1116 * originator mac */
1116 orig_neigh_node = (is_single_hop_neigh ? 1117 orig_neigh_node = (is_single_hop_neigh ?
1117 orig_node : 1118 orig_node :
1118 get_orig_node(bat_priv, ethhdr->h_source)); 1119 batadv_get_orig_node(bat_priv, ethhdr->h_source));
1119 if (!orig_neigh_node) 1120 if (!orig_neigh_node)
1120 goto out; 1121 goto out;
1121 1122
1122 orig_neigh_router = orig_node_get_router(orig_neigh_node); 1123 orig_neigh_router = batadv_orig_node_get_router(orig_neigh_node);
1123 1124
1124 /* drop packet if sender is not a direct neighbor and if we 1125 /* drop packet if sender is not a direct neighbor and if we
1125 * don't route towards it */ 1126 * don't route towards it */
@@ -1178,16 +1179,16 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1178 1179
1179out_neigh: 1180out_neigh:
1180 if ((orig_neigh_node) && (!is_single_hop_neigh)) 1181 if ((orig_neigh_node) && (!is_single_hop_neigh))
1181 orig_node_free_ref(orig_neigh_node); 1182 batadv_orig_node_free_ref(orig_neigh_node);
1182out: 1183out:
1183 if (router) 1184 if (router)
1184 neigh_node_free_ref(router); 1185 batadv_neigh_node_free_ref(router);
1185 if (router_router) 1186 if (router_router)
1186 neigh_node_free_ref(router_router); 1187 batadv_neigh_node_free_ref(router_router);
1187 if (orig_neigh_router) 1188 if (orig_neigh_router)
1188 neigh_node_free_ref(orig_neigh_router); 1189 batadv_neigh_node_free_ref(orig_neigh_router);
1189 1190
1190 orig_node_free_ref(orig_node); 1191 batadv_orig_node_free_ref(orig_node);
1191} 1192}
1192 1193
1193static int bat_iv_ogm_receive(struct sk_buff *skb, 1194static int bat_iv_ogm_receive(struct sk_buff *skb,
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index eb2178951c39..c4b28af69297 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -399,7 +399,7 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv,
399 if (orig_node) { 399 if (orig_node) {
400 tt_global_del_orig(bat_priv, orig_node, 400 tt_global_del_orig(bat_priv, orig_node,
401 "became a backbone gateway"); 401 "became a backbone gateway");
402 orig_node_free_ref(orig_node); 402 batadv_orig_node_free_ref(orig_node);
403 } 403 }
404 return entry; 404 return entry;
405} 405}
@@ -804,7 +804,7 @@ static int check_claim_group(struct bat_priv *bat_priv,
804 bla_dst_own->group = bla_dst->group; 804 bla_dst_own->group = bla_dst->group;
805 } 805 }
806 806
807 orig_node_free_ref(orig_node); 807 batadv_orig_node_free_ref(orig_node);
808 808
809 return 2; 809 return 2;
810} 810}
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index a3f944b6ac53..e92055da5074 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -124,7 +124,7 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv)
124 continue; 124 continue;
125 125
126 orig_node = gw_node->orig_node; 126 orig_node = gw_node->orig_node;
127 router = orig_node_get_router(orig_node); 127 router = batadv_orig_node_get_router(orig_node);
128 if (!router) 128 if (!router)
129 continue; 129 continue;
130 130
@@ -177,7 +177,7 @@ static struct gw_node *gw_get_best_gw_node(struct bat_priv *bat_priv)
177 gw_node_free_ref(gw_node); 177 gw_node_free_ref(gw_node);
178 178
179next: 179next:
180 neigh_node_free_ref(router); 180 batadv_neigh_node_free_ref(router);
181 } 181 }
182 rcu_read_unlock(); 182 rcu_read_unlock();
183 183
@@ -212,7 +212,7 @@ void batadv_gw_election(struct bat_priv *bat_priv)
212 if (next_gw) { 212 if (next_gw) {
213 sprintf(gw_addr, "%pM", next_gw->orig_node->orig); 213 sprintf(gw_addr, "%pM", next_gw->orig_node->orig);
214 214
215 router = orig_node_get_router(next_gw->orig_node); 215 router = batadv_orig_node_get_router(next_gw->orig_node);
216 if (!router) { 216 if (!router) {
217 batadv_gw_deselect(bat_priv); 217 batadv_gw_deselect(bat_priv);
218 goto out; 218 goto out;
@@ -245,7 +245,7 @@ out:
245 if (next_gw) 245 if (next_gw)
246 gw_node_free_ref(next_gw); 246 gw_node_free_ref(next_gw);
247 if (router) 247 if (router)
248 neigh_node_free_ref(router); 248 batadv_neigh_node_free_ref(router);
249} 249}
250 250
251void batadv_gw_check_election(struct bat_priv *bat_priv, 251void batadv_gw_check_election(struct bat_priv *bat_priv,
@@ -259,7 +259,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
259 if (!curr_gw_orig) 259 if (!curr_gw_orig)
260 goto deselect; 260 goto deselect;
261 261
262 router_gw = orig_node_get_router(curr_gw_orig); 262 router_gw = batadv_orig_node_get_router(curr_gw_orig);
263 if (!router_gw) 263 if (!router_gw)
264 goto deselect; 264 goto deselect;
265 265
@@ -267,7 +267,7 @@ void batadv_gw_check_election(struct bat_priv *bat_priv,
267 if (curr_gw_orig == orig_node) 267 if (curr_gw_orig == orig_node)
268 goto out; 268 goto out;
269 269
270 router_orig = orig_node_get_router(orig_node); 270 router_orig = batadv_orig_node_get_router(orig_node);
271 if (!router_orig) 271 if (!router_orig)
272 goto out; 272 goto out;
273 273
@@ -294,11 +294,11 @@ deselect:
294 batadv_gw_deselect(bat_priv); 294 batadv_gw_deselect(bat_priv);
295out: 295out:
296 if (curr_gw_orig) 296 if (curr_gw_orig)
297 orig_node_free_ref(curr_gw_orig); 297 batadv_orig_node_free_ref(curr_gw_orig);
298 if (router_gw) 298 if (router_gw)
299 neigh_node_free_ref(router_gw); 299 batadv_neigh_node_free_ref(router_gw);
300 if (router_orig) 300 if (router_orig)
301 neigh_node_free_ref(router_orig); 301 batadv_neigh_node_free_ref(router_orig);
302 302
303 return; 303 return;
304} 304}
@@ -438,7 +438,7 @@ static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq,
438 438
439 batadv_gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up); 439 batadv_gw_bandwidth_to_kbit(gw_node->orig_node->gw_flags, &down, &up);
440 440
441 router = orig_node_get_router(gw_node->orig_node); 441 router = batadv_orig_node_get_router(gw_node->orig_node);
442 if (!router) 442 if (!router)
443 goto out; 443 goto out;
444 444
@@ -455,7 +455,7 @@ static int _write_buffer_text(struct bat_priv *bat_priv, struct seq_file *seq,
455 (up > 2048 ? up / 1024 : up), 455 (up > 2048 ? up / 1024 : up),
456 (up > 2048 ? "MBit" : "KBit")); 456 (up > 2048 ? "MBit" : "KBit"));
457 457
458 neigh_node_free_ref(router); 458 batadv_neigh_node_free_ref(router);
459 if (curr_gw) 459 if (curr_gw)
460 gw_node_free_ref(curr_gw); 460 gw_node_free_ref(curr_gw);
461out: 461out:
@@ -702,12 +702,12 @@ bool batadv_gw_out_of_range(struct bat_priv *bat_priv,
702 702
703out: 703out:
704 if (orig_dst_node) 704 if (orig_dst_node)
705 orig_node_free_ref(orig_dst_node); 705 batadv_orig_node_free_ref(orig_dst_node);
706 if (curr_gw) 706 if (curr_gw)
707 gw_node_free_ref(curr_gw); 707 gw_node_free_ref(curr_gw);
708 if (neigh_old) 708 if (neigh_old)
709 neigh_node_free_ref(neigh_old); 709 batadv_neigh_node_free_ref(neigh_old);
710 if (neigh_curr) 710 if (neigh_curr)
711 neigh_node_free_ref(neigh_curr); 711 batadv_neigh_node_free_ref(neigh_curr);
712 return out_of_range; 712 return out_of_range;
713} 713}
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 4f44f049186f..1f126cbd2c79 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -312,7 +312,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
312 hard_iface->if_num = bat_priv->num_ifaces; 312 hard_iface->if_num = bat_priv->num_ifaces;
313 bat_priv->num_ifaces++; 313 bat_priv->num_ifaces++;
314 hard_iface->if_status = IF_INACTIVE; 314 hard_iface->if_status = IF_INACTIVE;
315 orig_hash_add_if(hard_iface, bat_priv->num_ifaces); 315 batadv_orig_hash_add_if(hard_iface, bat_priv->num_ifaces);
316 316
317 hard_iface->batman_adv_ptype.type = __constant_htons(ETH_P_BATMAN); 317 hard_iface->batman_adv_ptype.type = __constant_htons(ETH_P_BATMAN);
318 hard_iface->batman_adv_ptype.func = batman_skb_recv; 318 hard_iface->batman_adv_ptype.func = batman_skb_recv;
@@ -373,7 +373,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
373 dev_remove_pack(&hard_iface->batman_adv_ptype); 373 dev_remove_pack(&hard_iface->batman_adv_ptype);
374 374
375 bat_priv->num_ifaces--; 375 bat_priv->num_ifaces--;
376 orig_hash_del_if(hard_iface, bat_priv->num_ifaces); 376 batadv_orig_hash_del_if(hard_iface, bat_priv->num_ifaces);
377 377
378 primary_if = primary_if_get_selected(bat_priv); 378 primary_if = primary_if_get_selected(bat_priv);
379 if (hard_iface == primary_if) { 379 if (hard_iface == primary_if) {
@@ -390,7 +390,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
390 hard_iface->if_status = IF_NOT_IN_USE; 390 hard_iface->if_status = IF_NOT_IN_USE;
391 391
392 /* delete all references to this hard_iface */ 392 /* delete all references to this hard_iface */
393 purge_orig_ref(bat_priv); 393 batadv_purge_orig_ref(bat_priv);
394 purge_outstanding_packets(bat_priv, hard_iface); 394 purge_outstanding_packets(bat_priv, hard_iface);
395 dev_put(hard_iface->soft_iface); 395 dev_put(hard_iface->soft_iface);
396 396
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 38ca3a853a2b..44cbee58720b 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -219,7 +219,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
219 if (!orig_node) 219 if (!orig_node)
220 goto dst_unreach; 220 goto dst_unreach;
221 221
222 neigh_node = orig_node_get_router(orig_node); 222 neigh_node = batadv_orig_node_get_router(orig_node);
223 if (!neigh_node) 223 if (!neigh_node)
224 goto dst_unreach; 224 goto dst_unreach;
225 225
@@ -248,9 +248,9 @@ out:
248 if (primary_if) 248 if (primary_if)
249 hardif_free_ref(primary_if); 249 hardif_free_ref(primary_if);
250 if (neigh_node) 250 if (neigh_node)
251 neigh_node_free_ref(neigh_node); 251 batadv_neigh_node_free_ref(neigh_node);
252 if (orig_node) 252 if (orig_node)
253 orig_node_free_ref(orig_node); 253 batadv_orig_node_free_ref(orig_node);
254 return len; 254 return len;
255} 255}
256 256
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 84dbda50aa90..eba5d2899b25 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -111,7 +111,7 @@ int mesh_init(struct net_device *soft_iface)
111 INIT_LIST_HEAD(&bat_priv->tt_req_list); 111 INIT_LIST_HEAD(&bat_priv->tt_req_list);
112 INIT_LIST_HEAD(&bat_priv->tt_roam_list); 112 INIT_LIST_HEAD(&bat_priv->tt_roam_list);
113 113
114 ret = originator_init(bat_priv); 114 ret = batadv_originator_init(bat_priv);
115 if (ret < 0) 115 if (ret < 0)
116 goto err; 116 goto err;
117 117
@@ -150,7 +150,7 @@ void mesh_free(struct net_device *soft_iface)
150 vis_quit(bat_priv); 150 vis_quit(bat_priv);
151 151
152 batadv_gw_node_purge(bat_priv); 152 batadv_gw_node_purge(bat_priv);
153 originator_free(bat_priv); 153 batadv_originator_free(bat_priv);
154 154
155 tt_free(bat_priv); 155 tt_free(bat_priv);
156 156
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 410a197854ed..93585132049f 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -47,7 +47,7 @@ static int compare_orig(const struct hlist_node *node, const void *data2)
47 return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); 47 return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
48} 48}
49 49
50int originator_init(struct bat_priv *bat_priv) 50int batadv_originator_init(struct bat_priv *bat_priv)
51{ 51{
52 if (bat_priv->orig_hash) 52 if (bat_priv->orig_hash)
53 return 0; 53 return 0;
@@ -64,14 +64,14 @@ err:
64 return -ENOMEM; 64 return -ENOMEM;
65} 65}
66 66
67void neigh_node_free_ref(struct neigh_node *neigh_node) 67void batadv_neigh_node_free_ref(struct neigh_node *neigh_node)
68{ 68{
69 if (atomic_dec_and_test(&neigh_node->refcount)) 69 if (atomic_dec_and_test(&neigh_node->refcount))
70 kfree_rcu(neigh_node, rcu); 70 kfree_rcu(neigh_node, rcu);
71} 71}
72 72
73/* increases the refcounter of a found router */ 73/* increases the refcounter of a found router */
74struct neigh_node *orig_node_get_router(struct orig_node *orig_node) 74struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node)
75{ 75{
76 struct neigh_node *router; 76 struct neigh_node *router;
77 77
@@ -126,14 +126,14 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
126 list_for_each_entry_safe(neigh_node, tmp_neigh_node, 126 list_for_each_entry_safe(neigh_node, tmp_neigh_node,
127 &orig_node->bond_list, bonding_list) { 127 &orig_node->bond_list, bonding_list) {
128 list_del_rcu(&neigh_node->bonding_list); 128 list_del_rcu(&neigh_node->bonding_list);
129 neigh_node_free_ref(neigh_node); 129 batadv_neigh_node_free_ref(neigh_node);
130 } 130 }
131 131
132 /* for all neighbors towards this originator ... */ 132 /* for all neighbors towards this originator ... */
133 hlist_for_each_entry_safe(neigh_node, node, node_tmp, 133 hlist_for_each_entry_safe(neigh_node, node, node_tmp,
134 &orig_node->neigh_list, list) { 134 &orig_node->neigh_list, list) {
135 hlist_del_rcu(&neigh_node->list); 135 hlist_del_rcu(&neigh_node->list);
136 neigh_node_free_ref(neigh_node); 136 batadv_neigh_node_free_ref(neigh_node);
137 } 137 }
138 138
139 spin_unlock_bh(&orig_node->neigh_list_lock); 139 spin_unlock_bh(&orig_node->neigh_list_lock);
@@ -148,13 +148,13 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
148 kfree(orig_node); 148 kfree(orig_node);
149} 149}
150 150
151void orig_node_free_ref(struct orig_node *orig_node) 151void batadv_orig_node_free_ref(struct orig_node *orig_node)
152{ 152{
153 if (atomic_dec_and_test(&orig_node->refcount)) 153 if (atomic_dec_and_test(&orig_node->refcount))
154 call_rcu(&orig_node->rcu, orig_node_free_rcu); 154 call_rcu(&orig_node->rcu, orig_node_free_rcu);
155} 155}
156 156
157void originator_free(struct bat_priv *bat_priv) 157void batadv_originator_free(struct bat_priv *bat_priv)
158{ 158{
159 struct hashtable_t *hash = bat_priv->orig_hash; 159 struct hashtable_t *hash = bat_priv->orig_hash;
160 struct hlist_node *node, *node_tmp; 160 struct hlist_node *node, *node_tmp;
@@ -179,7 +179,7 @@ void originator_free(struct bat_priv *bat_priv)
179 head, hash_entry) { 179 head, hash_entry) {
180 180
181 hlist_del_rcu(node); 181 hlist_del_rcu(node);
182 orig_node_free_ref(orig_node); 182 batadv_orig_node_free_ref(orig_node);
183 } 183 }
184 spin_unlock_bh(list_lock); 184 spin_unlock_bh(list_lock);
185 } 185 }
@@ -189,7 +189,8 @@ void originator_free(struct bat_priv *bat_priv)
189 189
190/* this function finds or creates an originator entry for the given 190/* this function finds or creates an originator entry for the given
191 * address if it does not exits */ 191 * address if it does not exits */
192struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr) 192struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
193 const uint8_t *addr)
193{ 194{
194 struct orig_node *orig_node; 195 struct orig_node *orig_node;
195 int size; 196 int size;
@@ -307,7 +308,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
307 308
308 hlist_del_rcu(&neigh_node->list); 309 hlist_del_rcu(&neigh_node->list);
309 bonding_candidate_del(orig_node, neigh_node); 310 bonding_candidate_del(orig_node, neigh_node);
310 neigh_node_free_ref(neigh_node); 311 batadv_neigh_node_free_ref(neigh_node);
311 } else { 312 } else {
312 if ((!*best_neigh_node) || 313 if ((!*best_neigh_node) ||
313 (neigh_node->tq_avg > (*best_neigh_node)->tq_avg)) 314 (neigh_node->tq_avg > (*best_neigh_node)->tq_avg))
@@ -364,7 +365,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
364 batadv_gw_node_delete(bat_priv, 365 batadv_gw_node_delete(bat_priv,
365 orig_node); 366 orig_node);
366 hlist_del_rcu(node); 367 hlist_del_rcu(node);
367 orig_node_free_ref(orig_node); 368 batadv_orig_node_free_ref(orig_node);
368 continue; 369 continue;
369 } 370 }
370 371
@@ -390,12 +391,12 @@ static void purge_orig(struct work_struct *work)
390 start_purge_timer(bat_priv); 391 start_purge_timer(bat_priv);
391} 392}
392 393
393void purge_orig_ref(struct bat_priv *bat_priv) 394void batadv_purge_orig_ref(struct bat_priv *bat_priv)
394{ 395{
395 _purge_orig(bat_priv); 396 _purge_orig(bat_priv);
396} 397}
397 398
398int orig_seq_print_text(struct seq_file *seq, void *offset) 399int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
399{ 400{
400 struct net_device *net_dev = (struct net_device *)seq->private; 401 struct net_device *net_dev = (struct net_device *)seq->private;
401 struct bat_priv *bat_priv = netdev_priv(net_dev); 402 struct bat_priv *bat_priv = netdev_priv(net_dev);
@@ -439,7 +440,7 @@ int orig_seq_print_text(struct seq_file *seq, void *offset)
439 440
440 rcu_read_lock(); 441 rcu_read_lock();
441 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 442 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
442 neigh_node = orig_node_get_router(orig_node); 443 neigh_node = batadv_orig_node_get_router(orig_node);
443 if (!neigh_node) 444 if (!neigh_node)
444 continue; 445 continue;
445 446
@@ -468,7 +469,7 @@ int orig_seq_print_text(struct seq_file *seq, void *offset)
468 batman_count++; 469 batman_count++;
469 470
470next: 471next:
471 neigh_node_free_ref(neigh_node); 472 batadv_neigh_node_free_ref(neigh_node);
472 } 473 }
473 rcu_read_unlock(); 474 rcu_read_unlock();
474 } 475 }
@@ -508,7 +509,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
508 return 0; 509 return 0;
509} 510}
510 511
511int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num) 512int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
512{ 513{
513 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 514 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
514 struct hashtable_t *hash = bat_priv->orig_hash; 515 struct hashtable_t *hash = bat_priv->orig_hash;
@@ -590,7 +591,7 @@ free_own_sum:
590 return 0; 591 return 0;
591} 592}
592 593
593int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num) 594int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num)
594{ 595{
595 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); 596 struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface);
596 struct hashtable_t *hash = bat_priv->orig_hash; 597 struct hashtable_t *hash = bat_priv->orig_hash;
diff --git a/net/batman-adv/originator.h b/net/batman-adv/originator.h
index f74d0d693359..97deeba787ea 100644
--- a/net/batman-adv/originator.h
+++ b/net/batman-adv/originator.h
@@ -24,19 +24,20 @@
24 24
25#include "hash.h" 25#include "hash.h"
26 26
27int originator_init(struct bat_priv *bat_priv); 27int batadv_originator_init(struct bat_priv *bat_priv);
28void originator_free(struct bat_priv *bat_priv); 28void batadv_originator_free(struct bat_priv *bat_priv);
29void purge_orig_ref(struct bat_priv *bat_priv); 29void batadv_purge_orig_ref(struct bat_priv *bat_priv);
30void orig_node_free_ref(struct orig_node *orig_node); 30void batadv_orig_node_free_ref(struct orig_node *orig_node);
31struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr); 31struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
32 const uint8_t *addr);
32struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface, 33struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface,
33 const uint8_t *neigh_addr, 34 const uint8_t *neigh_addr,
34 uint32_t seqno); 35 uint32_t seqno);
35void neigh_node_free_ref(struct neigh_node *neigh_node); 36void batadv_neigh_node_free_ref(struct neigh_node *neigh_node);
36struct neigh_node *orig_node_get_router(struct orig_node *orig_node); 37struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node);
37int orig_seq_print_text(struct seq_file *seq, void *offset); 38int batadv_orig_seq_print_text(struct seq_file *seq, void *offset);
38int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num); 39int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num);
39int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num); 40int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
40 41
41 42
42/* hashfunction to choose an entry in a hash table of given size */ 43/* hashfunction to choose an entry in a hash table of given size */
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 7525e4fd2faf..77fe46065db6 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -69,7 +69,7 @@ static void _update_route(struct bat_priv *bat_priv,
69{ 69{
70 struct neigh_node *curr_router; 70 struct neigh_node *curr_router;
71 71
72 curr_router = orig_node_get_router(orig_node); 72 curr_router = batadv_orig_node_get_router(orig_node);
73 73
74 /* route deleted */ 74 /* route deleted */
75 if ((curr_router) && (!neigh_node)) { 75 if ((curr_router) && (!neigh_node)) {
@@ -93,7 +93,7 @@ static void _update_route(struct bat_priv *bat_priv,
93 } 93 }
94 94
95 if (curr_router) 95 if (curr_router)
96 neigh_node_free_ref(curr_router); 96 batadv_neigh_node_free_ref(curr_router);
97 97
98 /* increase refcount of new best neighbor */ 98 /* increase refcount of new best neighbor */
99 if (neigh_node && !atomic_inc_not_zero(&neigh_node->refcount)) 99 if (neigh_node && !atomic_inc_not_zero(&neigh_node->refcount))
@@ -105,7 +105,7 @@ static void _update_route(struct bat_priv *bat_priv,
105 105
106 /* decrease refcount of previous best neighbor */ 106 /* decrease refcount of previous best neighbor */
107 if (curr_router) 107 if (curr_router)
108 neigh_node_free_ref(curr_router); 108 batadv_neigh_node_free_ref(curr_router);
109} 109}
110 110
111void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node, 111void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
@@ -116,14 +116,14 @@ void update_route(struct bat_priv *bat_priv, struct orig_node *orig_node,
116 if (!orig_node) 116 if (!orig_node)
117 goto out; 117 goto out;
118 118
119 router = orig_node_get_router(orig_node); 119 router = batadv_orig_node_get_router(orig_node);
120 120
121 if (router != neigh_node) 121 if (router != neigh_node)
122 _update_route(bat_priv, orig_node, neigh_node); 122 _update_route(bat_priv, orig_node, neigh_node);
123 123
124out: 124out:
125 if (router) 125 if (router)
126 neigh_node_free_ref(router); 126 batadv_neigh_node_free_ref(router);
127} 127}
128 128
129/* caller must hold the neigh_list_lock */ 129/* caller must hold the neigh_list_lock */
@@ -136,7 +136,7 @@ void bonding_candidate_del(struct orig_node *orig_node,
136 136
137 list_del_rcu(&neigh_node->bonding_list); 137 list_del_rcu(&neigh_node->bonding_list);
138 INIT_LIST_HEAD(&neigh_node->bonding_list); 138 INIT_LIST_HEAD(&neigh_node->bonding_list);
139 neigh_node_free_ref(neigh_node); 139 batadv_neigh_node_free_ref(neigh_node);
140 atomic_dec(&orig_node->bond_candidates); 140 atomic_dec(&orig_node->bond_candidates);
141 141
142out: 142out:
@@ -157,7 +157,7 @@ void bonding_candidate_add(struct orig_node *orig_node,
157 neigh_node->orig_node->primary_addr)) 157 neigh_node->orig_node->primary_addr))
158 goto candidate_del; 158 goto candidate_del;
159 159
160 router = orig_node_get_router(orig_node); 160 router = batadv_orig_node_get_router(orig_node);
161 if (!router) 161 if (!router)
162 goto candidate_del; 162 goto candidate_del;
163 163
@@ -210,7 +210,7 @@ out:
210 spin_unlock_bh(&orig_node->neigh_list_lock); 210 spin_unlock_bh(&orig_node->neigh_list_lock);
211 211
212 if (router) 212 if (router)
213 neigh_node_free_ref(router); 213 batadv_neigh_node_free_ref(router);
214} 214}
215 215
216/* copy primary address for bonding */ 216/* copy primary address for bonding */
@@ -303,7 +303,7 @@ static int recv_my_icmp_packet(struct bat_priv *bat_priv,
303 if (!orig_node) 303 if (!orig_node)
304 goto out; 304 goto out;
305 305
306 router = orig_node_get_router(orig_node); 306 router = batadv_orig_node_get_router(orig_node);
307 if (!router) 307 if (!router)
308 goto out; 308 goto out;
309 309
@@ -325,9 +325,9 @@ out:
325 if (primary_if) 325 if (primary_if)
326 hardif_free_ref(primary_if); 326 hardif_free_ref(primary_if);
327 if (router) 327 if (router)
328 neigh_node_free_ref(router); 328 batadv_neigh_node_free_ref(router);
329 if (orig_node) 329 if (orig_node)
330 orig_node_free_ref(orig_node); 330 batadv_orig_node_free_ref(orig_node);
331 return ret; 331 return ret;
332} 332}
333 333
@@ -358,7 +358,7 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
358 if (!orig_node) 358 if (!orig_node)
359 goto out; 359 goto out;
360 360
361 router = orig_node_get_router(orig_node); 361 router = batadv_orig_node_get_router(orig_node);
362 if (!router) 362 if (!router)
363 goto out; 363 goto out;
364 364
@@ -380,9 +380,9 @@ out:
380 if (primary_if) 380 if (primary_if)
381 hardif_free_ref(primary_if); 381 hardif_free_ref(primary_if);
382 if (router) 382 if (router)
383 neigh_node_free_ref(router); 383 batadv_neigh_node_free_ref(router);
384 if (orig_node) 384 if (orig_node)
385 orig_node_free_ref(orig_node); 385 batadv_orig_node_free_ref(orig_node);
386 return ret; 386 return ret;
387} 387}
388 388
@@ -444,7 +444,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
444 if (!orig_node) 444 if (!orig_node)
445 goto out; 445 goto out;
446 446
447 router = orig_node_get_router(orig_node); 447 router = batadv_orig_node_get_router(orig_node);
448 if (!router) 448 if (!router)
449 goto out; 449 goto out;
450 450
@@ -463,9 +463,9 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
463 463
464out: 464out:
465 if (router) 465 if (router)
466 neigh_node_free_ref(router); 466 batadv_neigh_node_free_ref(router);
467 if (orig_node) 467 if (orig_node)
468 orig_node_free_ref(orig_node); 468 batadv_orig_node_free_ref(orig_node);
469 return ret; 469 return ret;
470} 470}
471 471
@@ -551,13 +551,13 @@ static struct neigh_node *find_ifalter_router(struct orig_node *primary_orig,
551 /* decrement refcount of 551 /* decrement refcount of
552 * previously selected router */ 552 * previously selected router */
553 if (router) 553 if (router)
554 neigh_node_free_ref(router); 554 batadv_neigh_node_free_ref(router);
555 555
556 router = tmp_neigh_node; 556 router = tmp_neigh_node;
557 atomic_inc_not_zero(&router->refcount); 557 atomic_inc_not_zero(&router->refcount);
558 } 558 }
559 559
560 neigh_node_free_ref(tmp_neigh_node); 560 batadv_neigh_node_free_ref(tmp_neigh_node);
561 } 561 }
562 562
563 /* use the first candidate if nothing was found. */ 563 /* use the first candidate if nothing was found. */
@@ -695,7 +695,7 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
695 * packets for the correct destination. */ 695 * packets for the correct destination. */
696 bat_priv->tt_poss_change = true; 696 bat_priv->tt_poss_change = true;
697 697
698 orig_node_free_ref(orig_node); 698 batadv_orig_node_free_ref(orig_node);
699out: 699out:
700 /* returning NET_RX_DROP will make the caller function kfree the skb */ 700 /* returning NET_RX_DROP will make the caller function kfree the skb */
701 return NET_RX_DROP; 701 return NET_RX_DROP;
@@ -717,7 +717,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
717 if (!orig_node) 717 if (!orig_node)
718 return NULL; 718 return NULL;
719 719
720 router = orig_node_get_router(orig_node); 720 router = batadv_orig_node_get_router(orig_node);
721 if (!router) 721 if (!router)
722 goto err; 722 goto err;
723 723
@@ -750,7 +750,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
750 if (!primary_orig_node) 750 if (!primary_orig_node)
751 goto return_router; 751 goto return_router;
752 752
753 orig_node_free_ref(primary_orig_node); 753 batadv_orig_node_free_ref(primary_orig_node);
754 } 754 }
755 755
756 /* with less than 2 candidates, we can't do any 756 /* with less than 2 candidates, we can't do any
@@ -762,7 +762,7 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
762 * is is not on the interface where the packet came 762 * is is not on the interface where the packet came
763 * in. */ 763 * in. */
764 764
765 neigh_node_free_ref(router); 765 batadv_neigh_node_free_ref(router);
766 766
767 if (bonding_enabled) 767 if (bonding_enabled)
768 router = find_bond_router(primary_orig_node, recv_if); 768 router = find_bond_router(primary_orig_node, recv_if);
@@ -779,7 +779,7 @@ err_unlock:
779 rcu_read_unlock(); 779 rcu_read_unlock();
780err: 780err:
781 if (router) 781 if (router)
782 neigh_node_free_ref(router); 782 batadv_neigh_node_free_ref(router);
783 return NULL; 783 return NULL;
784} 784}
785 785
@@ -885,9 +885,9 @@ static int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
885 885
886out: 886out:
887 if (neigh_node) 887 if (neigh_node)
888 neigh_node_free_ref(neigh_node); 888 batadv_neigh_node_free_ref(neigh_node);
889 if (orig_node) 889 if (orig_node)
890 orig_node_free_ref(orig_node); 890 batadv_orig_node_free_ref(orig_node);
891 return ret; 891 return ret;
892} 892}
893 893
@@ -917,7 +917,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
917 917
918 curr_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn); 918 curr_ttvn = (uint8_t)atomic_read(&orig_node->last_ttvn);
919 tt_poss_change = orig_node->tt_poss_change; 919 tt_poss_change = orig_node->tt_poss_change;
920 orig_node_free_ref(orig_node); 920 batadv_orig_node_free_ref(orig_node);
921 } 921 }
922 922
923 /* Check whether I have to reroute the packet */ 923 /* Check whether I have to reroute the packet */
@@ -952,7 +952,7 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
952 ETH_ALEN); 952 ETH_ALEN);
953 curr_ttvn = (uint8_t) 953 curr_ttvn = (uint8_t)
954 atomic_read(&orig_node->last_ttvn); 954 atomic_read(&orig_node->last_ttvn);
955 orig_node_free_ref(orig_node); 955 batadv_orig_node_free_ref(orig_node);
956 } 956 }
957 957
958 bat_dbg(DBG_ROUTES, bat_priv, 958 bat_dbg(DBG_ROUTES, bat_priv,
@@ -1110,7 +1110,7 @@ spin_unlock:
1110 spin_unlock_bh(&orig_node->bcast_seqno_lock); 1110 spin_unlock_bh(&orig_node->bcast_seqno_lock);
1111out: 1111out:
1112 if (orig_node) 1112 if (orig_node)
1113 orig_node_free_ref(orig_node); 1113 batadv_orig_node_free_ref(orig_node);
1114 return ret; 1114 return ret;
1115} 1115}
1116 1116
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index a7cbc915afef..3d2c3b142cf1 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -142,7 +142,7 @@ static void tt_orig_list_entry_free_rcu(struct rcu_head *rcu)
142 142
143 orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu); 143 orig_entry = container_of(rcu, struct tt_orig_list_entry, rcu);
144 atomic_dec(&orig_entry->orig_node->tt_size); 144 atomic_dec(&orig_entry->orig_node->tt_size);
145 orig_node_free_ref(orig_entry->orig_node); 145 batadv_orig_node_free_ref(orig_entry->orig_node);
146 kfree(orig_entry); 146 kfree(orig_entry);
147} 147}
148 148
@@ -1080,7 +1080,7 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
1080 rcu_read_lock(); 1080 rcu_read_lock();
1081 head = &tt_global_entry->orig_list; 1081 head = &tt_global_entry->orig_list;
1082 hlist_for_each_entry_rcu(orig_entry, node, head, list) { 1082 hlist_for_each_entry_rcu(orig_entry, node, head, list) {
1083 router = orig_node_get_router(orig_entry->orig_node); 1083 router = batadv_orig_node_get_router(orig_entry->orig_node);
1084 if (!router) 1084 if (!router)
1085 continue; 1085 continue;
1086 1086
@@ -1088,7 +1088,7 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
1088 orig_node = orig_entry->orig_node; 1088 orig_node = orig_entry->orig_node;
1089 best_tq = router->tq_avg; 1089 best_tq = router->tq_avg;
1090 } 1090 }
1091 neigh_node_free_ref(router); 1091 batadv_neigh_node_free_ref(router);
1092 } 1092 }
1093 /* found anything? */ 1093 /* found anything? */
1094 if (orig_node && !atomic_inc_not_zero(&orig_node->refcount)) 1094 if (orig_node && !atomic_inc_not_zero(&orig_node->refcount))
@@ -1395,7 +1395,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
1395 if (full_table) 1395 if (full_table)
1396 tt_request->flags |= TT_FULL_TABLE; 1396 tt_request->flags |= TT_FULL_TABLE;
1397 1397
1398 neigh_node = orig_node_get_router(dst_orig_node); 1398 neigh_node = batadv_orig_node_get_router(dst_orig_node);
1399 if (!neigh_node) 1399 if (!neigh_node)
1400 goto out; 1400 goto out;
1401 1401
@@ -1411,7 +1411,7 @@ static int send_tt_request(struct bat_priv *bat_priv,
1411 1411
1412out: 1412out:
1413 if (neigh_node) 1413 if (neigh_node)
1414 neigh_node_free_ref(neigh_node); 1414 batadv_neigh_node_free_ref(neigh_node);
1415 if (primary_if) 1415 if (primary_if)
1416 hardif_free_ref(primary_if); 1416 hardif_free_ref(primary_if);
1417 if (ret) 1417 if (ret)
@@ -1453,7 +1453,7 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
1453 if (!res_dst_orig_node) 1453 if (!res_dst_orig_node)
1454 goto out; 1454 goto out;
1455 1455
1456 neigh_node = orig_node_get_router(res_dst_orig_node); 1456 neigh_node = batadv_orig_node_get_router(res_dst_orig_node);
1457 if (!neigh_node) 1457 if (!neigh_node)
1458 goto out; 1458 goto out;
1459 1459
@@ -1541,11 +1541,11 @@ unlock:
1541 1541
1542out: 1542out:
1543 if (res_dst_orig_node) 1543 if (res_dst_orig_node)
1544 orig_node_free_ref(res_dst_orig_node); 1544 batadv_orig_node_free_ref(res_dst_orig_node);
1545 if (req_dst_orig_node) 1545 if (req_dst_orig_node)
1546 orig_node_free_ref(req_dst_orig_node); 1546 batadv_orig_node_free_ref(req_dst_orig_node);
1547 if (neigh_node) 1547 if (neigh_node)
1548 neigh_node_free_ref(neigh_node); 1548 batadv_neigh_node_free_ref(neigh_node);
1549 if (primary_if) 1549 if (primary_if)
1550 hardif_free_ref(primary_if); 1550 hardif_free_ref(primary_if);
1551 if (!ret) 1551 if (!ret)
@@ -1580,7 +1580,7 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
1580 if (!orig_node) 1580 if (!orig_node)
1581 goto out; 1581 goto out;
1582 1582
1583 neigh_node = orig_node_get_router(orig_node); 1583 neigh_node = batadv_orig_node_get_router(orig_node);
1584 if (!neigh_node) 1584 if (!neigh_node)
1585 goto out; 1585 goto out;
1586 1586
@@ -1658,9 +1658,9 @@ unlock:
1658 spin_unlock_bh(&bat_priv->tt_buff_lock); 1658 spin_unlock_bh(&bat_priv->tt_buff_lock);
1659out: 1659out:
1660 if (orig_node) 1660 if (orig_node)
1661 orig_node_free_ref(orig_node); 1661 batadv_orig_node_free_ref(orig_node);
1662 if (neigh_node) 1662 if (neigh_node)
1663 neigh_node_free_ref(neigh_node); 1663 batadv_neigh_node_free_ref(neigh_node);
1664 if (primary_if) 1664 if (primary_if)
1665 hardif_free_ref(primary_if); 1665 hardif_free_ref(primary_if);
1666 if (!ret) 1666 if (!ret)
@@ -1738,7 +1738,7 @@ static void tt_fill_gtable(struct bat_priv *bat_priv,
1738 1738
1739out: 1739out:
1740 if (orig_node) 1740 if (orig_node)
1741 orig_node_free_ref(orig_node); 1741 batadv_orig_node_free_ref(orig_node);
1742} 1742}
1743 1743
1744static void tt_update_changes(struct bat_priv *bat_priv, 1744static void tt_update_changes(struct bat_priv *bat_priv,
@@ -1818,7 +1818,7 @@ void handle_tt_response(struct bat_priv *bat_priv,
1818 orig_node->tt_poss_change = false; 1818 orig_node->tt_poss_change = false;
1819out: 1819out:
1820 if (orig_node) 1820 if (orig_node)
1821 orig_node_free_ref(orig_node); 1821 batadv_orig_node_free_ref(orig_node);
1822} 1822}
1823 1823
1824int tt_init(struct bat_priv *bat_priv) 1824int tt_init(struct bat_priv *bat_priv)
@@ -1947,7 +1947,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
1947 memcpy(roam_adv_packet->dst, orig_node->orig, ETH_ALEN); 1947 memcpy(roam_adv_packet->dst, orig_node->orig, ETH_ALEN);
1948 memcpy(roam_adv_packet->client, client, ETH_ALEN); 1948 memcpy(roam_adv_packet->client, client, ETH_ALEN);
1949 1949
1950 neigh_node = orig_node_get_router(orig_node); 1950 neigh_node = batadv_orig_node_get_router(orig_node);
1951 if (!neigh_node) 1951 if (!neigh_node)
1952 goto out; 1952 goto out;
1953 1953
@@ -1962,7 +1962,7 @@ static void send_roam_adv(struct bat_priv *bat_priv, uint8_t *client,
1962 1962
1963out: 1963out:
1964 if (neigh_node) 1964 if (neigh_node)
1965 neigh_node_free_ref(neigh_node); 1965 batadv_neigh_node_free_ref(neigh_node);
1966 if (ret) 1966 if (ret)
1967 kfree_skb(skb); 1967 kfree_skb(skb);
1968 return; 1968 return;
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 92d3ea3e6ce4..6117100c292c 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -212,7 +212,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
212 212
213out: 213out:
214 if (orig_node) 214 if (orig_node)
215 orig_node_free_ref(orig_node); 215 batadv_orig_node_free_ref(orig_node);
216 return ret; 216 return ret;
217} 217}
218 218
@@ -355,9 +355,9 @@ find_router:
355 355
356out: 356out:
357 if (neigh_node) 357 if (neigh_node)
358 neigh_node_free_ref(neigh_node); 358 batadv_neigh_node_free_ref(neigh_node);
359 if (orig_node) 359 if (orig_node)
360 orig_node_free_ref(orig_node); 360 batadv_orig_node_free_ref(orig_node);
361 if (ret == 1) 361 if (ret == 1)
362 kfree_skb(skb); 362 kfree_skb(skb);
363 return ret; 363 return ret;
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index 99f1931472f3..1972a11aace1 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -574,7 +574,7 @@ static int find_best_vis_server(struct bat_priv *bat_priv,
574 574
575 rcu_read_lock(); 575 rcu_read_lock();
576 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 576 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
577 router = orig_node_get_router(orig_node); 577 router = batadv_orig_node_get_router(orig_node);
578 if (!router) 578 if (!router)
579 continue; 579 continue;
580 580
@@ -584,7 +584,7 @@ static int find_best_vis_server(struct bat_priv *bat_priv,
584 memcpy(packet->target_orig, orig_node->orig, 584 memcpy(packet->target_orig, orig_node->orig,
585 ETH_ALEN); 585 ETH_ALEN);
586 } 586 }
587 neigh_node_free_ref(router); 587 batadv_neigh_node_free_ref(router);
588 } 588 }
589 rcu_read_unlock(); 589 rcu_read_unlock();
590 } 590 }
@@ -641,7 +641,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
641 641
642 rcu_read_lock(); 642 rcu_read_lock();
643 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 643 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
644 router = orig_node_get_router(orig_node); 644 router = batadv_orig_node_get_router(orig_node);
645 if (!router) 645 if (!router)
646 continue; 646 continue;
647 647
@@ -665,7 +665,7 @@ static int generate_vis_packet(struct bat_priv *bat_priv)
665 packet->entries++; 665 packet->entries++;
666 666
667next: 667next:
668 neigh_node_free_ref(router); 668 batadv_neigh_node_free_ref(router);
669 669
670 if (vis_packet_full(info)) 670 if (vis_packet_full(info))
671 goto unlock; 671 goto unlock;
@@ -757,7 +757,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
757 if (!(orig_node->flags & VIS_SERVER)) 757 if (!(orig_node->flags & VIS_SERVER))
758 continue; 758 continue;
759 759
760 router = orig_node_get_router(orig_node); 760 router = batadv_orig_node_get_router(orig_node);
761 if (!router) 761 if (!router)
762 continue; 762 continue;
763 763
@@ -765,7 +765,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
765 * this node. */ 765 * this node. */
766 if (recv_list_is_in(bat_priv, &info->recv_list, 766 if (recv_list_is_in(bat_priv, &info->recv_list,
767 orig_node->orig)) { 767 orig_node->orig)) {
768 neigh_node_free_ref(router); 768 batadv_neigh_node_free_ref(router);
769 continue; 769 continue;
770 } 770 }
771 771
@@ -773,7 +773,7 @@ static void broadcast_vis_packet(struct bat_priv *bat_priv,
773 hard_iface = router->if_incoming; 773 hard_iface = router->if_incoming;
774 memcpy(dstaddr, router->addr, ETH_ALEN); 774 memcpy(dstaddr, router->addr, ETH_ALEN);
775 775
776 neigh_node_free_ref(router); 776 batadv_neigh_node_free_ref(router);
777 777
778 skb = skb_clone(info->skb_packet, GFP_ATOMIC); 778 skb = skb_clone(info->skb_packet, GFP_ATOMIC);
779 if (skb) 779 if (skb)
@@ -798,7 +798,7 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
798 if (!orig_node) 798 if (!orig_node)
799 goto out; 799 goto out;
800 800
801 router = orig_node_get_router(orig_node); 801 router = batadv_orig_node_get_router(orig_node);
802 if (!router) 802 if (!router)
803 goto out; 803 goto out;
804 804
@@ -808,9 +808,9 @@ static void unicast_vis_packet(struct bat_priv *bat_priv,
808 808
809out: 809out:
810 if (router) 810 if (router)
811 neigh_node_free_ref(router); 811 batadv_neigh_node_free_ref(router);
812 if (orig_node) 812 if (orig_node)
813 orig_node_free_ref(orig_node); 813 batadv_orig_node_free_ref(orig_node);
814} 814}
815 815
816/* only send one vis packet. called from send_vis_packets() */ 816/* only send one vis packet. called from send_vis_packets() */