0001
0002
0003
0004
0005
0006
0007 #include "gateway_client.h"
0008 #include "main.h"
0009
0010 #include <linux/atomic.h>
0011 #include <linux/byteorder/generic.h>
0012 #include <linux/container_of.h>
0013 #include <linux/errno.h>
0014 #include <linux/etherdevice.h>
0015 #include <linux/gfp.h>
0016 #include <linux/if_ether.h>
0017 #include <linux/if_vlan.h>
0018 #include <linux/in.h>
0019 #include <linux/ip.h>
0020 #include <linux/ipv6.h>
0021 #include <linux/kernel.h>
0022 #include <linux/kref.h>
0023 #include <linux/list.h>
0024 #include <linux/lockdep.h>
0025 #include <linux/netdevice.h>
0026 #include <linux/netlink.h>
0027 #include <linux/rculist.h>
0028 #include <linux/rcupdate.h>
0029 #include <linux/skbuff.h>
0030 #include <linux/slab.h>
0031 #include <linux/spinlock.h>
0032 #include <linux/stddef.h>
0033 #include <linux/udp.h>
0034 #include <net/sock.h>
0035 #include <uapi/linux/batadv_packet.h>
0036 #include <uapi/linux/batman_adv.h>
0037
0038 #include "hard-interface.h"
0039 #include "log.h"
0040 #include "netlink.h"
0041 #include "originator.h"
0042 #include "routing.h"
0043 #include "soft-interface.h"
0044 #include "translation-table.h"
0045
0046
0047
0048
0049 #define BATADV_DHCP_HTYPE_OFFSET 1
0050 #define BATADV_DHCP_HLEN_OFFSET 2
0051
0052 #define BATADV_DHCP_HTYPE_ETHERNET 0x01
0053
0054
0055
0056 #define BATADV_DHCP_CHADDR_OFFSET 28
0057
0058
0059
0060
0061
0062
0063 void batadv_gw_node_release(struct kref *ref)
0064 {
0065 struct batadv_gw_node *gw_node;
0066
0067 gw_node = container_of(ref, struct batadv_gw_node, refcount);
0068
0069 batadv_orig_node_put(gw_node->orig_node);
0070 kfree_rcu(gw_node, rcu);
0071 }
0072
0073
0074
0075
0076
0077
0078
0079 struct batadv_gw_node *
0080 batadv_gw_get_selected_gw_node(struct batadv_priv *bat_priv)
0081 {
0082 struct batadv_gw_node *gw_node;
0083
0084 rcu_read_lock();
0085 gw_node = rcu_dereference(bat_priv->gw.curr_gw);
0086 if (!gw_node)
0087 goto out;
0088
0089 if (!kref_get_unless_zero(&gw_node->refcount))
0090 gw_node = NULL;
0091
0092 out:
0093 rcu_read_unlock();
0094 return gw_node;
0095 }
0096
0097
0098
0099
0100
0101
0102
0103 struct batadv_orig_node *
0104 batadv_gw_get_selected_orig(struct batadv_priv *bat_priv)
0105 {
0106 struct batadv_gw_node *gw_node;
0107 struct batadv_orig_node *orig_node = NULL;
0108
0109 gw_node = batadv_gw_get_selected_gw_node(bat_priv);
0110 if (!gw_node)
0111 goto out;
0112
0113 rcu_read_lock();
0114 orig_node = gw_node->orig_node;
0115 if (!orig_node)
0116 goto unlock;
0117
0118 if (!kref_get_unless_zero(&orig_node->refcount))
0119 orig_node = NULL;
0120
0121 unlock:
0122 rcu_read_unlock();
0123 out:
0124 batadv_gw_node_put(gw_node);
0125 return orig_node;
0126 }
0127
0128 static void batadv_gw_select(struct batadv_priv *bat_priv,
0129 struct batadv_gw_node *new_gw_node)
0130 {
0131 struct batadv_gw_node *curr_gw_node;
0132
0133 spin_lock_bh(&bat_priv->gw.list_lock);
0134
0135 if (new_gw_node)
0136 kref_get(&new_gw_node->refcount);
0137
0138 curr_gw_node = rcu_replace_pointer(bat_priv->gw.curr_gw, new_gw_node,
0139 true);
0140
0141 batadv_gw_node_put(curr_gw_node);
0142
0143 spin_unlock_bh(&bat_priv->gw.list_lock);
0144 }
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 void batadv_gw_reselect(struct batadv_priv *bat_priv)
0158 {
0159 atomic_set(&bat_priv->gw.reselect, 1);
0160 }
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170 void batadv_gw_check_client_stop(struct batadv_priv *bat_priv)
0171 {
0172 struct batadv_gw_node *curr_gw;
0173
0174 if (atomic_read(&bat_priv->gw.mode) != BATADV_GW_MODE_CLIENT)
0175 return;
0176
0177 curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
0178 if (!curr_gw)
0179 return;
0180
0181
0182
0183
0184 batadv_gw_select(bat_priv, NULL);
0185
0186
0187
0188
0189 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_DEL, NULL);
0190
0191 batadv_gw_node_put(curr_gw);
0192 }
0193
0194
0195
0196
0197
0198 void batadv_gw_election(struct batadv_priv *bat_priv)
0199 {
0200 struct batadv_gw_node *curr_gw = NULL;
0201 struct batadv_gw_node *next_gw = NULL;
0202 struct batadv_neigh_node *router = NULL;
0203 struct batadv_neigh_ifinfo *router_ifinfo = NULL;
0204 char gw_addr[18] = { '\0' };
0205
0206 if (atomic_read(&bat_priv->gw.mode) != BATADV_GW_MODE_CLIENT)
0207 goto out;
0208
0209 if (!bat_priv->algo_ops->gw.get_best_gw_node)
0210 goto out;
0211
0212 curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
0213
0214 if (!batadv_atomic_dec_not_zero(&bat_priv->gw.reselect) && curr_gw)
0215 goto out;
0216
0217
0218
0219
0220
0221 next_gw = bat_priv->algo_ops->gw.get_best_gw_node(bat_priv);
0222
0223 if (curr_gw == next_gw)
0224 goto out;
0225
0226 if (next_gw) {
0227 sprintf(gw_addr, "%pM", next_gw->orig_node->orig);
0228
0229 router = batadv_orig_router_get(next_gw->orig_node,
0230 BATADV_IF_DEFAULT);
0231 if (!router) {
0232 batadv_gw_reselect(bat_priv);
0233 goto out;
0234 }
0235
0236 router_ifinfo = batadv_neigh_ifinfo_get(router,
0237 BATADV_IF_DEFAULT);
0238 if (!router_ifinfo) {
0239 batadv_gw_reselect(bat_priv);
0240 goto out;
0241 }
0242 }
0243
0244 if (curr_gw && !next_gw) {
0245 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
0246 "Removing selected gateway - no gateway in range\n");
0247 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_DEL,
0248 NULL);
0249 } else if (!curr_gw && next_gw) {
0250 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
0251 "Adding route to gateway %pM (bandwidth: %u.%u/%u.%u MBit, tq: %i)\n",
0252 next_gw->orig_node->orig,
0253 next_gw->bandwidth_down / 10,
0254 next_gw->bandwidth_down % 10,
0255 next_gw->bandwidth_up / 10,
0256 next_gw->bandwidth_up % 10,
0257 router_ifinfo->bat_iv.tq_avg);
0258 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_ADD,
0259 gw_addr);
0260 } else {
0261 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
0262 "Changing route to gateway %pM (bandwidth: %u.%u/%u.%u MBit, tq: %i)\n",
0263 next_gw->orig_node->orig,
0264 next_gw->bandwidth_down / 10,
0265 next_gw->bandwidth_down % 10,
0266 next_gw->bandwidth_up / 10,
0267 next_gw->bandwidth_up % 10,
0268 router_ifinfo->bat_iv.tq_avg);
0269 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_CHANGE,
0270 gw_addr);
0271 }
0272
0273 batadv_gw_select(bat_priv, next_gw);
0274
0275 out:
0276 batadv_gw_node_put(curr_gw);
0277 batadv_gw_node_put(next_gw);
0278 batadv_neigh_node_put(router);
0279 batadv_neigh_ifinfo_put(router_ifinfo);
0280 }
0281
0282
0283
0284
0285
0286
0287 void batadv_gw_check_election(struct batadv_priv *bat_priv,
0288 struct batadv_orig_node *orig_node)
0289 {
0290 struct batadv_orig_node *curr_gw_orig;
0291
0292
0293
0294
0295 if (!bat_priv->algo_ops->gw.is_eligible)
0296 return;
0297
0298 curr_gw_orig = batadv_gw_get_selected_orig(bat_priv);
0299 if (!curr_gw_orig)
0300 goto reselect;
0301
0302
0303 if (curr_gw_orig == orig_node)
0304 goto out;
0305
0306 if (!bat_priv->algo_ops->gw.is_eligible(bat_priv, curr_gw_orig,
0307 orig_node))
0308 goto out;
0309
0310 reselect:
0311 batadv_gw_reselect(bat_priv);
0312 out:
0313 batadv_orig_node_put(curr_gw_orig);
0314 }
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325 static void batadv_gw_node_add(struct batadv_priv *bat_priv,
0326 struct batadv_orig_node *orig_node,
0327 struct batadv_tvlv_gateway_data *gateway)
0328 {
0329 struct batadv_gw_node *gw_node;
0330
0331 lockdep_assert_held(&bat_priv->gw.list_lock);
0332
0333 if (gateway->bandwidth_down == 0)
0334 return;
0335
0336 gw_node = kzalloc(sizeof(*gw_node), GFP_ATOMIC);
0337 if (!gw_node)
0338 return;
0339
0340 kref_init(&gw_node->refcount);
0341 INIT_HLIST_NODE(&gw_node->list);
0342 kref_get(&orig_node->refcount);
0343 gw_node->orig_node = orig_node;
0344 gw_node->bandwidth_down = ntohl(gateway->bandwidth_down);
0345 gw_node->bandwidth_up = ntohl(gateway->bandwidth_up);
0346
0347 kref_get(&gw_node->refcount);
0348 hlist_add_head_rcu(&gw_node->list, &bat_priv->gw.gateway_list);
0349 bat_priv->gw.generation++;
0350
0351 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
0352 "Found new gateway %pM -> gw bandwidth: %u.%u/%u.%u MBit\n",
0353 orig_node->orig,
0354 ntohl(gateway->bandwidth_down) / 10,
0355 ntohl(gateway->bandwidth_down) % 10,
0356 ntohl(gateway->bandwidth_up) / 10,
0357 ntohl(gateway->bandwidth_up) % 10);
0358
0359
0360 batadv_gw_node_put(gw_node);
0361 }
0362
0363
0364
0365
0366
0367
0368
0369
0370 struct batadv_gw_node *batadv_gw_node_get(struct batadv_priv *bat_priv,
0371 struct batadv_orig_node *orig_node)
0372 {
0373 struct batadv_gw_node *gw_node_tmp, *gw_node = NULL;
0374
0375 rcu_read_lock();
0376 hlist_for_each_entry_rcu(gw_node_tmp, &bat_priv->gw.gateway_list,
0377 list) {
0378 if (gw_node_tmp->orig_node != orig_node)
0379 continue;
0380
0381 if (!kref_get_unless_zero(&gw_node_tmp->refcount))
0382 continue;
0383
0384 gw_node = gw_node_tmp;
0385 break;
0386 }
0387 rcu_read_unlock();
0388
0389 return gw_node;
0390 }
0391
0392
0393
0394
0395
0396
0397
0398
0399 void batadv_gw_node_update(struct batadv_priv *bat_priv,
0400 struct batadv_orig_node *orig_node,
0401 struct batadv_tvlv_gateway_data *gateway)
0402 {
0403 struct batadv_gw_node *gw_node, *curr_gw = NULL;
0404
0405 spin_lock_bh(&bat_priv->gw.list_lock);
0406 gw_node = batadv_gw_node_get(bat_priv, orig_node);
0407 if (!gw_node) {
0408 batadv_gw_node_add(bat_priv, orig_node, gateway);
0409 spin_unlock_bh(&bat_priv->gw.list_lock);
0410 goto out;
0411 }
0412 spin_unlock_bh(&bat_priv->gw.list_lock);
0413
0414 if (gw_node->bandwidth_down == ntohl(gateway->bandwidth_down) &&
0415 gw_node->bandwidth_up == ntohl(gateway->bandwidth_up))
0416 goto out;
0417
0418 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
0419 "Gateway bandwidth of originator %pM changed from %u.%u/%u.%u MBit to %u.%u/%u.%u MBit\n",
0420 orig_node->orig,
0421 gw_node->bandwidth_down / 10,
0422 gw_node->bandwidth_down % 10,
0423 gw_node->bandwidth_up / 10,
0424 gw_node->bandwidth_up % 10,
0425 ntohl(gateway->bandwidth_down) / 10,
0426 ntohl(gateway->bandwidth_down) % 10,
0427 ntohl(gateway->bandwidth_up) / 10,
0428 ntohl(gateway->bandwidth_up) % 10);
0429
0430 gw_node->bandwidth_down = ntohl(gateway->bandwidth_down);
0431 gw_node->bandwidth_up = ntohl(gateway->bandwidth_up);
0432
0433 if (ntohl(gateway->bandwidth_down) == 0) {
0434 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
0435 "Gateway %pM removed from gateway list\n",
0436 orig_node->orig);
0437
0438
0439
0440
0441 spin_lock_bh(&bat_priv->gw.list_lock);
0442 if (!hlist_unhashed(&gw_node->list)) {
0443 hlist_del_init_rcu(&gw_node->list);
0444 batadv_gw_node_put(gw_node);
0445 bat_priv->gw.generation++;
0446 }
0447 spin_unlock_bh(&bat_priv->gw.list_lock);
0448
0449 curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
0450 if (gw_node == curr_gw)
0451 batadv_gw_reselect(bat_priv);
0452
0453 batadv_gw_node_put(curr_gw);
0454 }
0455
0456 out:
0457 batadv_gw_node_put(gw_node);
0458 }
0459
0460
0461
0462
0463
0464
0465 void batadv_gw_node_delete(struct batadv_priv *bat_priv,
0466 struct batadv_orig_node *orig_node)
0467 {
0468 struct batadv_tvlv_gateway_data gateway;
0469
0470 gateway.bandwidth_down = 0;
0471 gateway.bandwidth_up = 0;
0472
0473 batadv_gw_node_update(bat_priv, orig_node, &gateway);
0474 }
0475
0476
0477
0478
0479
0480 void batadv_gw_node_free(struct batadv_priv *bat_priv)
0481 {
0482 struct batadv_gw_node *gw_node;
0483 struct hlist_node *node_tmp;
0484
0485 spin_lock_bh(&bat_priv->gw.list_lock);
0486 hlist_for_each_entry_safe(gw_node, node_tmp,
0487 &bat_priv->gw.gateway_list, list) {
0488 hlist_del_init_rcu(&gw_node->list);
0489 batadv_gw_node_put(gw_node);
0490 bat_priv->gw.generation++;
0491 }
0492 spin_unlock_bh(&bat_priv->gw.list_lock);
0493 }
0494
0495
0496
0497
0498
0499
0500
0501
0502 int batadv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb)
0503 {
0504 struct batadv_hard_iface *primary_if = NULL;
0505 struct net *net = sock_net(cb->skb->sk);
0506 struct net_device *soft_iface;
0507 struct batadv_priv *bat_priv;
0508 int ifindex;
0509 int ret;
0510
0511 ifindex = batadv_netlink_get_ifindex(cb->nlh,
0512 BATADV_ATTR_MESH_IFINDEX);
0513 if (!ifindex)
0514 return -EINVAL;
0515
0516 soft_iface = dev_get_by_index(net, ifindex);
0517 if (!soft_iface || !batadv_softif_is_valid(soft_iface)) {
0518 ret = -ENODEV;
0519 goto out;
0520 }
0521
0522 bat_priv = netdev_priv(soft_iface);
0523
0524 primary_if = batadv_primary_if_get_selected(bat_priv);
0525 if (!primary_if || primary_if->if_status != BATADV_IF_ACTIVE) {
0526 ret = -ENOENT;
0527 goto out;
0528 }
0529
0530 if (!bat_priv->algo_ops->gw.dump) {
0531 ret = -EOPNOTSUPP;
0532 goto out;
0533 }
0534
0535 bat_priv->algo_ops->gw.dump(msg, cb, bat_priv);
0536
0537 ret = msg->len;
0538
0539 out:
0540 batadv_hardif_put(primary_if);
0541 dev_put(soft_iface);
0542
0543 return ret;
0544 }
0545
0546
0547
0548
0549
0550
0551
0552
0553
0554
0555
0556
0557
0558
0559
0560
0561 enum batadv_dhcp_recipient
0562 batadv_gw_dhcp_recipient_get(struct sk_buff *skb, unsigned int *header_len,
0563 u8 *chaddr)
0564 {
0565 enum batadv_dhcp_recipient ret = BATADV_DHCP_NO;
0566 struct ethhdr *ethhdr;
0567 struct iphdr *iphdr;
0568 struct ipv6hdr *ipv6hdr;
0569 struct udphdr *udphdr;
0570 struct vlan_ethhdr *vhdr;
0571 int chaddr_offset;
0572 __be16 proto;
0573 u8 *p;
0574
0575
0576 if (!pskb_may_pull(skb, *header_len + ETH_HLEN))
0577 return BATADV_DHCP_NO;
0578
0579 ethhdr = eth_hdr(skb);
0580 proto = ethhdr->h_proto;
0581 *header_len += ETH_HLEN;
0582
0583
0584 if (proto == htons(ETH_P_8021Q)) {
0585 if (!pskb_may_pull(skb, *header_len + VLAN_HLEN))
0586 return BATADV_DHCP_NO;
0587
0588 vhdr = vlan_eth_hdr(skb);
0589 proto = vhdr->h_vlan_encapsulated_proto;
0590 *header_len += VLAN_HLEN;
0591 }
0592
0593
0594 switch (proto) {
0595 case htons(ETH_P_IP):
0596 if (!pskb_may_pull(skb, *header_len + sizeof(*iphdr)))
0597 return BATADV_DHCP_NO;
0598
0599 iphdr = (struct iphdr *)(skb->data + *header_len);
0600 *header_len += iphdr->ihl * 4;
0601
0602
0603 if (iphdr->protocol != IPPROTO_UDP)
0604 return BATADV_DHCP_NO;
0605
0606 break;
0607 case htons(ETH_P_IPV6):
0608 if (!pskb_may_pull(skb, *header_len + sizeof(*ipv6hdr)))
0609 return BATADV_DHCP_NO;
0610
0611 ipv6hdr = (struct ipv6hdr *)(skb->data + *header_len);
0612 *header_len += sizeof(*ipv6hdr);
0613
0614
0615 if (ipv6hdr->nexthdr != IPPROTO_UDP)
0616 return BATADV_DHCP_NO;
0617
0618 break;
0619 default:
0620 return BATADV_DHCP_NO;
0621 }
0622
0623 if (!pskb_may_pull(skb, *header_len + sizeof(*udphdr)))
0624 return BATADV_DHCP_NO;
0625
0626 udphdr = (struct udphdr *)(skb->data + *header_len);
0627 *header_len += sizeof(*udphdr);
0628
0629
0630 switch (proto) {
0631 case htons(ETH_P_IP):
0632 if (udphdr->dest == htons(67))
0633 ret = BATADV_DHCP_TO_SERVER;
0634 else if (udphdr->source == htons(67))
0635 ret = BATADV_DHCP_TO_CLIENT;
0636 break;
0637 case htons(ETH_P_IPV6):
0638 if (udphdr->dest == htons(547))
0639 ret = BATADV_DHCP_TO_SERVER;
0640 else if (udphdr->source == htons(547))
0641 ret = BATADV_DHCP_TO_CLIENT;
0642 break;
0643 }
0644
0645 chaddr_offset = *header_len + BATADV_DHCP_CHADDR_OFFSET;
0646
0647 if (ret == BATADV_DHCP_TO_CLIENT) {
0648 if (!pskb_may_pull(skb, chaddr_offset + ETH_ALEN))
0649 return BATADV_DHCP_NO;
0650
0651
0652 p = skb->data + *header_len + BATADV_DHCP_HTYPE_OFFSET;
0653 if (*p != BATADV_DHCP_HTYPE_ETHERNET)
0654 return BATADV_DHCP_NO;
0655
0656
0657 p = skb->data + *header_len + BATADV_DHCP_HLEN_OFFSET;
0658 if (*p != ETH_ALEN)
0659 return BATADV_DHCP_NO;
0660
0661 ether_addr_copy(chaddr, skb->data + chaddr_offset);
0662 }
0663
0664 return ret;
0665 }
0666
0667
0668
0669
0670
0671
0672
0673
0674
0675
0676
0677
0678
0679
0680
0681
0682
0683 bool batadv_gw_out_of_range(struct batadv_priv *bat_priv,
0684 struct sk_buff *skb)
0685 {
0686 struct batadv_neigh_node *neigh_curr = NULL;
0687 struct batadv_neigh_node *neigh_old = NULL;
0688 struct batadv_orig_node *orig_dst_node = NULL;
0689 struct batadv_gw_node *gw_node = NULL;
0690 struct batadv_gw_node *curr_gw = NULL;
0691 struct batadv_neigh_ifinfo *curr_ifinfo, *old_ifinfo;
0692 struct ethhdr *ethhdr = (struct ethhdr *)skb->data;
0693 bool out_of_range = false;
0694 u8 curr_tq_avg;
0695 unsigned short vid;
0696
0697 vid = batadv_get_vid(skb, 0);
0698
0699 if (is_multicast_ether_addr(ethhdr->h_dest))
0700 goto out;
0701
0702 orig_dst_node = batadv_transtable_search(bat_priv, ethhdr->h_source,
0703 ethhdr->h_dest, vid);
0704 if (!orig_dst_node)
0705 goto out;
0706
0707 gw_node = batadv_gw_node_get(bat_priv, orig_dst_node);
0708 if (!gw_node)
0709 goto out;
0710
0711 switch (atomic_read(&bat_priv->gw.mode)) {
0712 case BATADV_GW_MODE_SERVER:
0713
0714
0715
0716 curr_tq_avg = BATADV_TQ_MAX_VALUE;
0717 break;
0718 case BATADV_GW_MODE_CLIENT:
0719 curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
0720 if (!curr_gw)
0721 goto out;
0722
0723
0724 if (curr_gw->orig_node == orig_dst_node)
0725 goto out;
0726
0727
0728
0729
0730
0731 neigh_curr = batadv_find_router(bat_priv, curr_gw->orig_node,
0732 NULL);
0733 if (!neigh_curr)
0734 goto out;
0735
0736 curr_ifinfo = batadv_neigh_ifinfo_get(neigh_curr,
0737 BATADV_IF_DEFAULT);
0738 if (!curr_ifinfo)
0739 goto out;
0740
0741 curr_tq_avg = curr_ifinfo->bat_iv.tq_avg;
0742 batadv_neigh_ifinfo_put(curr_ifinfo);
0743
0744 break;
0745 case BATADV_GW_MODE_OFF:
0746 default:
0747 goto out;
0748 }
0749
0750 neigh_old = batadv_find_router(bat_priv, orig_dst_node, NULL);
0751 if (!neigh_old)
0752 goto out;
0753
0754 old_ifinfo = batadv_neigh_ifinfo_get(neigh_old, BATADV_IF_DEFAULT);
0755 if (!old_ifinfo)
0756 goto out;
0757
0758 if ((curr_tq_avg - old_ifinfo->bat_iv.tq_avg) > BATADV_GW_THRESHOLD)
0759 out_of_range = true;
0760 batadv_neigh_ifinfo_put(old_ifinfo);
0761
0762 out:
0763 batadv_orig_node_put(orig_dst_node);
0764 batadv_gw_node_put(curr_gw);
0765 batadv_gw_node_put(gw_node);
0766 batadv_neigh_node_put(neigh_old);
0767 batadv_neigh_node_put(neigh_curr);
0768 return out_of_range;
0769 }