aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-06 13:12:52 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-06 13:12:52 -0400
commit4bc4e64c2cfdafa6b8ecdcc5edf10cc1a147587f (patch)
treeae4f83cd06353b43c8b5105567145c8eb3d5e4f7
parentd2746fe5380e9af79807994756672baaf42cb130 (diff)
parent706cc9f51d9a22528af18d4b3ffbd17b30a1d3b0 (diff)
Merge tag 'batadv-next-for-davem-20171006' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - Cleanup patches to make checkpatch happy, by Sven Eckelmann (3 patches) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/batman-adv/bat_iv_ogm.c24
-rw-r--r--net/batman-adv/bat_v.c2
-rw-r--r--net/batman-adv/bat_v_elp.c6
-rw-r--r--net/batman-adv/bat_v_ogm.c12
-rw-r--r--net/batman-adv/distributed-arp-table.c4
-rw-r--r--net/batman-adv/gateway_client.c8
-rw-r--r--net/batman-adv/gateway_common.c18
-rw-r--r--net/batman-adv/hard-interface.c12
-rw-r--r--net/batman-adv/icmp_socket.c4
-rw-r--r--net/batman-adv/main.c12
-rw-r--r--net/batman-adv/main.h2
-rw-r--r--net/batman-adv/multicast.c2
-rw-r--r--net/batman-adv/originator.c26
-rw-r--r--net/batman-adv/routing.c6
-rw-r--r--net/batman-adv/send.c6
-rw-r--r--net/batman-adv/soft-interface.c6
-rw-r--r--net/batman-adv/sysfs.c4
-rw-r--r--net/batman-adv/tp_meter.c2
18 files changed, 78 insertions, 78 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 83ba5483455a..1b659ab652fb 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -916,8 +916,8 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface)
916 u16 tvlv_len = 0; 916 u16 tvlv_len = 0;
917 unsigned long send_time; 917 unsigned long send_time;
918 918
919 if ((hard_iface->if_status == BATADV_IF_NOT_IN_USE) || 919 if (hard_iface->if_status == BATADV_IF_NOT_IN_USE ||
920 (hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)) 920 hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)
921 return; 921 return;
922 922
923 /* the interface gets activated here to avoid race conditions between 923 /* the interface gets activated here to avoid race conditions between
@@ -1264,7 +1264,7 @@ static bool batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node,
1264 * drops as they can't send and receive at the same time. 1264 * drops as they can't send and receive at the same time.
1265 */ 1265 */
1266 tq_iface_penalty = BATADV_TQ_MAX_VALUE; 1266 tq_iface_penalty = BATADV_TQ_MAX_VALUE;
1267 if (if_outgoing && (if_incoming == if_outgoing) && 1267 if (if_outgoing && if_incoming == if_outgoing &&
1268 batadv_is_wifi_hardif(if_outgoing)) 1268 batadv_is_wifi_hardif(if_outgoing))
1269 tq_iface_penalty = batadv_hop_penalty(BATADV_TQ_MAX_VALUE, 1269 tq_iface_penalty = batadv_hop_penalty(BATADV_TQ_MAX_VALUE,
1270 bat_priv); 1270 bat_priv);
@@ -1369,7 +1369,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
1369 ret = BATADV_NEIGH_DUP; 1369 ret = BATADV_NEIGH_DUP;
1370 } else { 1370 } else {
1371 set_mark = 0; 1371 set_mark = 0;
1372 if (is_dup && (ret != BATADV_NEIGH_DUP)) 1372 if (is_dup && ret != BATADV_NEIGH_DUP)
1373 ret = BATADV_ORIG_DUP; 1373 ret = BATADV_ORIG_DUP;
1374 } 1374 }
1375 1375
@@ -1515,7 +1515,7 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff *skb, int ogm_offset,
1515 /* drop packet if sender is not a direct neighbor and if we 1515 /* drop packet if sender is not a direct neighbor and if we
1516 * don't route towards it 1516 * don't route towards it
1517 */ 1517 */
1518 if (!is_single_hop_neigh && (!orig_neigh_router)) { 1518 if (!is_single_hop_neigh && !orig_neigh_router) {
1519 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 1519 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1520 "Drop packet: OGM via unknown neighbor!\n"); 1520 "Drop packet: OGM via unknown neighbor!\n");
1521 goto out_neigh; 1521 goto out_neigh;
@@ -1535,7 +1535,7 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff *skb, int ogm_offset,
1535 sameseq = orig_ifinfo->last_real_seqno == ntohl(ogm_packet->seqno); 1535 sameseq = orig_ifinfo->last_real_seqno == ntohl(ogm_packet->seqno);
1536 similar_ttl = (orig_ifinfo->last_ttl - 3) <= ogm_packet->ttl; 1536 similar_ttl = (orig_ifinfo->last_ttl - 3) <= ogm_packet->ttl;
1537 1537
1538 if (is_bidirect && ((dup_status == BATADV_NO_DUP) || 1538 if (is_bidirect && (dup_status == BATADV_NO_DUP ||
1539 (sameseq && similar_ttl))) { 1539 (sameseq && similar_ttl))) {
1540 batadv_iv_ogm_orig_update(bat_priv, orig_node, 1540 batadv_iv_ogm_orig_update(bat_priv, orig_node,
1541 orig_ifinfo, ethhdr, 1541 orig_ifinfo, ethhdr,
@@ -1553,8 +1553,8 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff *skb, int ogm_offset,
1553 /* OGMs from secondary interfaces should only scheduled once 1553 /* OGMs from secondary interfaces should only scheduled once
1554 * per interface where it has been received, not multiple times 1554 * per interface where it has been received, not multiple times
1555 */ 1555 */
1556 if ((ogm_packet->ttl <= 2) && 1556 if (ogm_packet->ttl <= 2 &&
1557 (if_incoming != if_outgoing)) { 1557 if_incoming != if_outgoing) {
1558 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 1558 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1559 "Drop packet: OGM from secondary interface and wrong outgoing interface\n"); 1559 "Drop packet: OGM from secondary interface and wrong outgoing interface\n");
1560 goto out_neigh; 1560 goto out_neigh;
@@ -1590,7 +1590,7 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff *skb, int ogm_offset,
1590 if_incoming, if_outgoing); 1590 if_incoming, if_outgoing);
1591 1591
1592out_neigh: 1592out_neigh:
1593 if ((orig_neigh_node) && (!is_single_hop_neigh)) 1593 if (orig_neigh_node && !is_single_hop_neigh)
1594 batadv_orig_node_put(orig_neigh_node); 1594 batadv_orig_node_put(orig_neigh_node);
1595out: 1595out:
1596 if (router_ifinfo) 1596 if (router_ifinfo)
@@ -2523,9 +2523,9 @@ batadv_iv_gw_get_best_gw_node(struct batadv_priv *bat_priv)
2523 tmp_gw_factor *= 100 * 100; 2523 tmp_gw_factor *= 100 * 100;
2524 tmp_gw_factor >>= 18; 2524 tmp_gw_factor >>= 18;
2525 2525
2526 if ((tmp_gw_factor > max_gw_factor) || 2526 if (tmp_gw_factor > max_gw_factor ||
2527 ((tmp_gw_factor == max_gw_factor) && 2527 (tmp_gw_factor == max_gw_factor &&
2528 (tq_avg > max_tq))) { 2528 tq_avg > max_tq)) {
2529 if (curr_gw) 2529 if (curr_gw)
2530 batadv_gw_node_put(curr_gw); 2530 batadv_gw_node_put(curr_gw);
2531 curr_gw = gw_node; 2531 curr_gw = gw_node;
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 4e2724c5b33d..93ef1c06227e 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -767,7 +767,7 @@ batadv_v_gw_get_best_gw_node(struct batadv_priv *bat_priv)
767 if (batadv_v_gw_throughput_get(gw_node, &bw) < 0) 767 if (batadv_v_gw_throughput_get(gw_node, &bw) < 0)
768 goto next; 768 goto next;
769 769
770 if (curr_gw && (bw <= max_bw)) 770 if (curr_gw && bw <= max_bw)
771 goto next; 771 goto next;
772 772
773 if (curr_gw) 773 if (curr_gw)
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c
index bd1064d98e16..1de992c58b35 100644
--- a/net/batman-adv/bat_v_elp.c
+++ b/net/batman-adv/bat_v_elp.c
@@ -134,7 +134,7 @@ static u32 batadv_v_elp_get_throughput(struct batadv_hardif_neigh_node *neigh)
134 hard_iface->bat_v.flags &= ~BATADV_FULL_DUPLEX; 134 hard_iface->bat_v.flags &= ~BATADV_FULL_DUPLEX;
135 135
136 throughput = link_settings.base.speed; 136 throughput = link_settings.base.speed;
137 if (throughput && (throughput != SPEED_UNKNOWN)) 137 if (throughput && throughput != SPEED_UNKNOWN)
138 return throughput * 10; 138 return throughput * 10;
139 } 139 }
140 140
@@ -263,8 +263,8 @@ static void batadv_v_elp_periodic_work(struct work_struct *work)
263 goto out; 263 goto out;
264 264
265 /* we are in the process of shutting this interface down */ 265 /* we are in the process of shutting this interface down */
266 if ((hard_iface->if_status == BATADV_IF_NOT_IN_USE) || 266 if (hard_iface->if_status == BATADV_IF_NOT_IN_USE ||
267 (hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)) 267 hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)
268 goto out; 268 goto out;
269 269
270 /* the interface was enabled but may not be ready yet */ 270 /* the interface was enabled but may not be ready yet */
diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index 8be61734fc43..c251445a42a0 100644
--- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c
@@ -304,8 +304,8 @@ static u32 batadv_v_forward_penalty(struct batadv_priv *bat_priv,
304 * due to the store & forward characteristics of WIFI. 304 * due to the store & forward characteristics of WIFI.
305 * Very low throughput values are the exception. 305 * Very low throughput values are the exception.
306 */ 306 */
307 if ((throughput > 10) && 307 if (throughput > 10 &&
308 (if_incoming == if_outgoing) && 308 if_incoming == if_outgoing &&
309 !(if_incoming->bat_v.flags & BATADV_FULL_DUPLEX)) 309 !(if_incoming->bat_v.flags & BATADV_FULL_DUPLEX))
310 return throughput / 2; 310 return throughput / 2;
311 311
@@ -455,7 +455,7 @@ static int batadv_v_ogm_metric_update(struct batadv_priv *bat_priv,
455 /* drop packets with old seqnos, however accept the first packet after 455 /* drop packets with old seqnos, however accept the first packet after
456 * a host has been rebooted. 456 * a host has been rebooted.
457 */ 457 */
458 if ((seq_diff < 0) && !protection_started) 458 if (seq_diff < 0 && !protection_started)
459 goto out; 459 goto out;
460 460
461 neigh_node->last_seen = jiffies; 461 neigh_node->last_seen = jiffies;
@@ -568,8 +568,8 @@ static bool batadv_v_ogm_route_update(struct batadv_priv *bat_priv,
568 router_throughput = router_ifinfo->bat_v.throughput; 568 router_throughput = router_ifinfo->bat_v.throughput;
569 neigh_throughput = neigh_ifinfo->bat_v.throughput; 569 neigh_throughput = neigh_ifinfo->bat_v.throughput;
570 570
571 if ((neigh_seq_diff < BATADV_OGM_MAX_ORIGDIFF) && 571 if (neigh_seq_diff < BATADV_OGM_MAX_ORIGDIFF &&
572 (router_throughput >= neigh_throughput)) 572 router_throughput >= neigh_throughput)
573 goto out; 573 goto out;
574 } 574 }
575 575
@@ -621,7 +621,7 @@ batadv_v_ogm_process_per_outif(struct batadv_priv *bat_priv,
621 return; 621 return;
622 622
623 /* only unknown & newer OGMs contain TVLVs we are interested in */ 623 /* only unknown & newer OGMs contain TVLVs we are interested in */
624 if ((seqno_age > 0) && (if_outgoing == BATADV_IF_DEFAULT)) 624 if (seqno_age > 0 && if_outgoing == BATADV_IF_DEFAULT)
625 batadv_tvlv_containers_process(bat_priv, true, orig_node, 625 batadv_tvlv_containers_process(bat_priv, true, orig_node,
626 NULL, NULL, 626 NULL, NULL,
627 (unsigned char *)(ogm2 + 1), 627 (unsigned char *)(ogm2 + 1),
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
index b6cfa78e9381..760c0de72582 100644
--- a/net/batman-adv/distributed-arp-table.c
+++ b/net/batman-adv/distributed-arp-table.c
@@ -492,8 +492,8 @@ static bool batadv_is_orig_node_eligible(struct batadv_dat_candidate *res,
492 /* this is an hash collision with the temporary selected node. Choose 492 /* this is an hash collision with the temporary selected node. Choose
493 * the one with the lowest address 493 * the one with the lowest address
494 */ 494 */
495 if ((tmp_max == max) && max_orig_node && 495 if (tmp_max == max && max_orig_node &&
496 (batadv_compare_eth(candidate->orig, max_orig_node->orig) > 0)) 496 batadv_compare_eth(candidate->orig, max_orig_node->orig) > 0)
497 goto out; 497 goto out;
498 498
499 ret = true; 499 ret = true;
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index de9955d5224d..10d521f0b17f 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -248,12 +248,12 @@ void batadv_gw_election(struct batadv_priv *bat_priv)
248 } 248 }
249 } 249 }
250 250
251 if ((curr_gw) && (!next_gw)) { 251 if (curr_gw && !next_gw) {
252 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 252 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
253 "Removing selected gateway - no gateway in range\n"); 253 "Removing selected gateway - no gateway in range\n");
254 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_DEL, 254 batadv_throw_uevent(bat_priv, BATADV_UEV_GW, BATADV_UEV_DEL,
255 NULL); 255 NULL);
256 } else if ((!curr_gw) && (next_gw)) { 256 } else if (!curr_gw && next_gw) {
257 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 257 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
258 "Adding route to gateway %pM (bandwidth: %u.%u/%u.%u MBit, tq: %i)\n", 258 "Adding route to gateway %pM (bandwidth: %u.%u/%u.%u MBit, tq: %i)\n",
259 next_gw->orig_node->orig, 259 next_gw->orig_node->orig,
@@ -411,8 +411,8 @@ void batadv_gw_node_update(struct batadv_priv *bat_priv,
411 goto out; 411 goto out;
412 } 412 }
413 413
414 if ((gw_node->bandwidth_down == ntohl(gateway->bandwidth_down)) && 414 if (gw_node->bandwidth_down == ntohl(gateway->bandwidth_down) &&
415 (gw_node->bandwidth_up == ntohl(gateway->bandwidth_up))) 415 gw_node->bandwidth_up == ntohl(gateway->bandwidth_up))
416 goto out; 416 goto out;
417 417
418 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 418 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c
index 33940c5c74a8..2c26039c23fc 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -56,8 +56,8 @@ bool batadv_parse_throughput(struct net_device *net_dev, char *buff,
56 if (strncasecmp(tmp_ptr, "mbit", 4) == 0) 56 if (strncasecmp(tmp_ptr, "mbit", 4) == 0)
57 bw_unit_type = BATADV_BW_UNIT_MBIT; 57 bw_unit_type = BATADV_BW_UNIT_MBIT;
58 58
59 if ((strncasecmp(tmp_ptr, "kbit", 4) == 0) || 59 if (strncasecmp(tmp_ptr, "kbit", 4) == 0 ||
60 (bw_unit_type == BATADV_BW_UNIT_MBIT)) 60 bw_unit_type == BATADV_BW_UNIT_MBIT)
61 *tmp_ptr = '\0'; 61 *tmp_ptr = '\0';
62 } 62 }
63 63
@@ -190,7 +190,7 @@ ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
190 if (!up_new) 190 if (!up_new)
191 up_new = 1; 191 up_new = 1;
192 192
193 if ((down_curr == down_new) && (up_curr == up_new)) 193 if (down_curr == down_new && up_curr == up_new)
194 return count; 194 return count;
195 195
196 batadv_gw_reselect(bat_priv); 196 batadv_gw_reselect(bat_priv);
@@ -224,16 +224,16 @@ static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
224 /* only fetch the tvlv value if the handler wasn't called via the 224 /* only fetch the tvlv value if the handler wasn't called via the
225 * CIFNOTFND flag and if there is data to fetch 225 * CIFNOTFND flag and if there is data to fetch
226 */ 226 */
227 if ((flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND) || 227 if (flags & BATADV_TVLV_HANDLER_OGM_CIFNOTFND ||
228 (tvlv_value_len < sizeof(gateway))) { 228 tvlv_value_len < sizeof(gateway)) {
229 gateway.bandwidth_down = 0; 229 gateway.bandwidth_down = 0;
230 gateway.bandwidth_up = 0; 230 gateway.bandwidth_up = 0;
231 } else { 231 } else {
232 gateway_ptr = tvlv_value; 232 gateway_ptr = tvlv_value;
233 gateway.bandwidth_down = gateway_ptr->bandwidth_down; 233 gateway.bandwidth_down = gateway_ptr->bandwidth_down;
234 gateway.bandwidth_up = gateway_ptr->bandwidth_up; 234 gateway.bandwidth_up = gateway_ptr->bandwidth_up;
235 if ((gateway.bandwidth_down == 0) || 235 if (gateway.bandwidth_down == 0 ||
236 (gateway.bandwidth_up == 0)) { 236 gateway.bandwidth_up == 0) {
237 gateway.bandwidth_down = 0; 237 gateway.bandwidth_down = 0;
238 gateway.bandwidth_up = 0; 238 gateway.bandwidth_up = 0;
239 } 239 }
@@ -242,8 +242,8 @@ static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
242 batadv_gw_node_update(bat_priv, orig, &gateway); 242 batadv_gw_node_update(bat_priv, orig, &gateway);
243 243
244 /* restart gateway selection */ 244 /* restart gateway selection */
245 if ((gateway.bandwidth_down != 0) && 245 if (gateway.bandwidth_down != 0 &&
246 (atomic_read(&bat_priv->gw.mode) == BATADV_GW_MODE_CLIENT)) 246 atomic_read(&bat_priv->gw.mode) == BATADV_GW_MODE_CLIENT)
247 batadv_gw_check_election(bat_priv, orig); 247 batadv_gw_check_election(bat_priv, orig);
248} 248}
249 249
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index f7b413b9297e..4e3d5340ad96 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -504,8 +504,8 @@ static void batadv_check_known_mac_addr(const struct net_device *net_dev)
504 504
505 rcu_read_lock(); 505 rcu_read_lock();
506 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 506 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
507 if ((hard_iface->if_status != BATADV_IF_ACTIVE) && 507 if (hard_iface->if_status != BATADV_IF_ACTIVE &&
508 (hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)) 508 hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)
509 continue; 509 continue;
510 510
511 if (hard_iface->net_dev == net_dev) 511 if (hard_iface->net_dev == net_dev)
@@ -568,8 +568,8 @@ int batadv_hardif_min_mtu(struct net_device *soft_iface)
568 568
569 rcu_read_lock(); 569 rcu_read_lock();
570 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 570 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) {
571 if ((hard_iface->if_status != BATADV_IF_ACTIVE) && 571 if (hard_iface->if_status != BATADV_IF_ACTIVE &&
572 (hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)) 572 hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)
573 continue; 573 continue;
574 574
575 if (hard_iface->soft_iface != soft_iface) 575 if (hard_iface->soft_iface != soft_iface)
@@ -654,8 +654,8 @@ out:
654static void 654static void
655batadv_hardif_deactivate_interface(struct batadv_hard_iface *hard_iface) 655batadv_hardif_deactivate_interface(struct batadv_hard_iface *hard_iface)
656{ 656{
657 if ((hard_iface->if_status != BATADV_IF_ACTIVE) && 657 if (hard_iface->if_status != BATADV_IF_ACTIVE &&
658 (hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)) 658 hard_iface->if_status != BATADV_IF_TO_BE_ACTIVATED)
659 return; 659 return;
660 660
661 hard_iface->if_status = BATADV_IF_INACTIVE; 661 hard_iface->if_status = BATADV_IF_INACTIVE;
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 8ead292886d1..bded31121d12 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -132,10 +132,10 @@ static ssize_t batadv_socket_read(struct file *file, char __user *buf,
132 size_t packet_len; 132 size_t packet_len;
133 int error; 133 int error;
134 134
135 if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) 135 if ((file->f_flags & O_NONBLOCK) && socket_client->queue_len == 0)
136 return -EAGAIN; 136 return -EAGAIN;
137 137
138 if ((!buf) || (count < sizeof(struct batadv_icmp_packet))) 138 if (!buf || count < sizeof(struct batadv_icmp_packet))
139 return -EINVAL; 139 return -EINVAL;
140 140
141 if (!access_ok(VERIFY_WRITE, buf, count)) 141 if (!access_ok(VERIFY_WRITE, buf, count))
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index fb381fb26a66..4daed7ad46f2 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -73,8 +73,8 @@
73 * list traversals just rcu-locked 73 * list traversals just rcu-locked
74 */ 74 */
75struct list_head batadv_hardif_list; 75struct list_head batadv_hardif_list;
76static int (*batadv_rx_handler[256])(struct sk_buff *, 76static int (*batadv_rx_handler[256])(struct sk_buff *skb,
77 struct batadv_hard_iface *); 77 struct batadv_hard_iface *recv_if);
78 78
79unsigned char batadv_broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 79unsigned char batadv_broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
80 80
@@ -540,12 +540,12 @@ batadv_recv_handler_register(u8 packet_type,
540 int (*recv_handler)(struct sk_buff *, 540 int (*recv_handler)(struct sk_buff *,
541 struct batadv_hard_iface *)) 541 struct batadv_hard_iface *))
542{ 542{
543 int (*curr)(struct sk_buff *, 543 int (*curr)(struct sk_buff *skb,
544 struct batadv_hard_iface *); 544 struct batadv_hard_iface *recv_if);
545 curr = batadv_rx_handler[packet_type]; 545 curr = batadv_rx_handler[packet_type];
546 546
547 if ((curr != batadv_recv_unhandled_packet) && 547 if (curr != batadv_recv_unhandled_packet &&
548 (curr != batadv_recv_unhandled_unicast_packet)) 548 curr != batadv_recv_unhandled_unicast_packet)
549 return -EBUSY; 549 return -EBUSY;
550 550
551 batadv_rx_handler[packet_type] = recv_handler; 551 batadv_rx_handler[packet_type] = recv_handler;
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 05cc7637c064..edb2f239d04d 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -24,7 +24,7 @@
24#define BATADV_DRIVER_DEVICE "batman-adv" 24#define BATADV_DRIVER_DEVICE "batman-adv"
25 25
26#ifndef BATADV_SOURCE_VERSION 26#ifndef BATADV_SOURCE_VERSION
27#define BATADV_SOURCE_VERSION "2017.3" 27#define BATADV_SOURCE_VERSION "2017.4"
28#endif 28#endif
29 29
30/* B.A.T.M.A.N. parameters */ 30/* B.A.T.M.A.N. parameters */
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index d327670641ac..e553a8770a89 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -1126,7 +1126,7 @@ static void batadv_mcast_tvlv_ogm_handler(struct batadv_priv *bat_priv,
1126 bool orig_initialized; 1126 bool orig_initialized;
1127 1127
1128 if (orig_mcast_enabled && tvlv_value && 1128 if (orig_mcast_enabled && tvlv_value &&
1129 (tvlv_value_len >= sizeof(mcast_flags))) 1129 tvlv_value_len >= sizeof(mcast_flags))
1130 mcast_flags = *(u8 *)tvlv_value; 1130 mcast_flags = *(u8 *)tvlv_value;
1131 1131
1132 spin_lock_bh(&orig->mcast_handler_lock); 1132 spin_lock_bh(&orig->mcast_handler_lock);
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 8e2a4b205257..2967b86c13da 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -1062,9 +1062,9 @@ batadv_purge_neigh_ifinfo(struct batadv_priv *bat_priv,
1062 continue; 1062 continue;
1063 1063
1064 /* don't purge if the interface is not (going) down */ 1064 /* don't purge if the interface is not (going) down */
1065 if ((if_outgoing->if_status != BATADV_IF_INACTIVE) && 1065 if (if_outgoing->if_status != BATADV_IF_INACTIVE &&
1066 (if_outgoing->if_status != BATADV_IF_NOT_IN_USE) && 1066 if_outgoing->if_status != BATADV_IF_NOT_IN_USE &&
1067 (if_outgoing->if_status != BATADV_IF_TO_BE_REMOVED)) 1067 if_outgoing->if_status != BATADV_IF_TO_BE_REMOVED)
1068 continue; 1068 continue;
1069 1069
1070 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 1070 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
@@ -1106,9 +1106,9 @@ batadv_purge_orig_ifinfo(struct batadv_priv *bat_priv,
1106 continue; 1106 continue;
1107 1107
1108 /* don't purge if the interface is not (going) down */ 1108 /* don't purge if the interface is not (going) down */
1109 if ((if_outgoing->if_status != BATADV_IF_INACTIVE) && 1109 if (if_outgoing->if_status != BATADV_IF_INACTIVE &&
1110 (if_outgoing->if_status != BATADV_IF_NOT_IN_USE) && 1110 if_outgoing->if_status != BATADV_IF_NOT_IN_USE &&
1111 (if_outgoing->if_status != BATADV_IF_TO_BE_REMOVED)) 1111 if_outgoing->if_status != BATADV_IF_TO_BE_REMOVED)
1112 continue; 1112 continue;
1113 1113
1114 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 1114 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
@@ -1155,13 +1155,13 @@ batadv_purge_orig_neighbors(struct batadv_priv *bat_priv,
1155 last_seen = neigh_node->last_seen; 1155 last_seen = neigh_node->last_seen;
1156 if_incoming = neigh_node->if_incoming; 1156 if_incoming = neigh_node->if_incoming;
1157 1157
1158 if ((batadv_has_timed_out(last_seen, BATADV_PURGE_TIMEOUT)) || 1158 if (batadv_has_timed_out(last_seen, BATADV_PURGE_TIMEOUT) ||
1159 (if_incoming->if_status == BATADV_IF_INACTIVE) || 1159 if_incoming->if_status == BATADV_IF_INACTIVE ||
1160 (if_incoming->if_status == BATADV_IF_NOT_IN_USE) || 1160 if_incoming->if_status == BATADV_IF_NOT_IN_USE ||
1161 (if_incoming->if_status == BATADV_IF_TO_BE_REMOVED)) { 1161 if_incoming->if_status == BATADV_IF_TO_BE_REMOVED) {
1162 if ((if_incoming->if_status == BATADV_IF_INACTIVE) || 1162 if (if_incoming->if_status == BATADV_IF_INACTIVE ||
1163 (if_incoming->if_status == BATADV_IF_NOT_IN_USE) || 1163 if_incoming->if_status == BATADV_IF_NOT_IN_USE ||
1164 (if_incoming->if_status == BATADV_IF_TO_BE_REMOVED)) 1164 if_incoming->if_status == BATADV_IF_TO_BE_REMOVED)
1165 batadv_dbg(BATADV_DBG_BATMAN, bat_priv, 1165 batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
1166 "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n", 1166 "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n",
1167 orig_node->orig, neigh_node->addr, 1167 orig_node->orig, neigh_node->addr,
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index f10e3ff26f9d..40d9bf3e5bfe 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -93,14 +93,14 @@ static void _batadv_update_route(struct batadv_priv *bat_priv,
93 batadv_orig_ifinfo_put(orig_ifinfo); 93 batadv_orig_ifinfo_put(orig_ifinfo);
94 94
95 /* route deleted */ 95 /* route deleted */
96 if ((curr_router) && (!neigh_node)) { 96 if (curr_router && !neigh_node) {
97 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, 97 batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
98 "Deleting route towards: %pM\n", orig_node->orig); 98 "Deleting route towards: %pM\n", orig_node->orig);
99 batadv_tt_global_del_orig(bat_priv, orig_node, -1, 99 batadv_tt_global_del_orig(bat_priv, orig_node, -1,
100 "Deleted route towards originator"); 100 "Deleted route towards originator");
101 101
102 /* route added */ 102 /* route added */
103 } else if ((!curr_router) && (neigh_node)) { 103 } else if (!curr_router && neigh_node) {
104 batadv_dbg(BATADV_DBG_ROUTES, bat_priv, 104 batadv_dbg(BATADV_DBG_ROUTES, bat_priv,
105 "Adding route towards: %pM (via %pM)\n", 105 "Adding route towards: %pM (via %pM)\n",
106 orig_node->orig, neigh_node->addr); 106 orig_node->orig, neigh_node->addr);
@@ -381,7 +381,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
381 /* add record route information if not full */ 381 /* add record route information if not full */
382 if ((icmph->msg_type == BATADV_ECHO_REPLY || 382 if ((icmph->msg_type == BATADV_ECHO_REPLY ||
383 icmph->msg_type == BATADV_ECHO_REQUEST) && 383 icmph->msg_type == BATADV_ECHO_REQUEST) &&
384 (skb->len >= sizeof(struct batadv_icmp_packet_rr))) { 384 skb->len >= sizeof(struct batadv_icmp_packet_rr)) {
385 if (skb_linearize(skb) < 0) 385 if (skb_linearize(skb) < 0)
386 goto free_skb; 386 goto free_skb;
387 387
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 054a65e6eb68..7895323fd2a7 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -142,7 +142,7 @@ int batadv_send_unicast_skb(struct sk_buff *skb,
142#ifdef CONFIG_BATMAN_ADV_BATMAN_V 142#ifdef CONFIG_BATMAN_ADV_BATMAN_V
143 hardif_neigh = batadv_hardif_neigh_get(neigh->if_incoming, neigh->addr); 143 hardif_neigh = batadv_hardif_neigh_get(neigh->if_incoming, neigh->addr);
144 144
145 if ((hardif_neigh) && (ret != NET_XMIT_DROP)) 145 if (hardif_neigh && ret != NET_XMIT_DROP)
146 hardif_neigh->bat_v.last_unicast_tx = jiffies; 146 hardif_neigh->bat_v.last_unicast_tx = jiffies;
147 147
148 if (hardif_neigh) 148 if (hardif_neigh)
@@ -615,8 +615,8 @@ batadv_forw_packet_list_steal(struct hlist_head *forw_list,
615 * we delete only packets belonging to the given interface 615 * we delete only packets belonging to the given interface
616 */ 616 */
617 if (hard_iface && 617 if (hard_iface &&
618 (forw_packet->if_incoming != hard_iface) && 618 forw_packet->if_incoming != hard_iface &&
619 (forw_packet->if_outgoing != hard_iface)) 619 forw_packet->if_outgoing != hard_iface)
620 continue; 620 continue;
621 621
622 hlist_del(&forw_packet->list); 622 hlist_del(&forw_packet->list);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index e7d5fbb6ad53..543d2c3e0f0d 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -69,8 +69,8 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
69 int result; 69 int result;
70 70
71 /* TODO: We must check if we can release all references to non-payload 71 /* TODO: We must check if we can release all references to non-payload
72 * data using __skb_header_release in our skbs to allow skb_cow_header to 72 * data using __skb_header_release in our skbs to allow skb_cow_header
73 * work optimally. This means that those skbs are not allowed to read 73 * to work optimally. This means that those skbs are not allowed to read
74 * or write any data which is before the current position of skb->data 74 * or write any data which is before the current position of skb->data
75 * after that call and thus allow other skbs with the same data buffer 75 * after that call and thus allow other skbs with the same data buffer
76 * to write freely in that area. 76 * to write freely in that area.
@@ -160,7 +160,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
160static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu) 160static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
161{ 161{
162 /* check ranges */ 162 /* check ranges */
163 if ((new_mtu < 68) || (new_mtu > batadv_hardif_min_mtu(dev))) 163 if (new_mtu < 68 || new_mtu > batadv_hardif_min_mtu(dev))
164 return -EINVAL; 164 return -EINVAL;
165 165
166 dev->mtu = new_mtu; 166 dev->mtu = new_mtu;
diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index 0ae8b30e4eaa..aa187fd42475 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -925,8 +925,8 @@ static int batadv_store_mesh_iface_finish(struct net_device *net_dev,
925 if (hard_iface->if_status == status_tmp) 925 if (hard_iface->if_status == status_tmp)
926 goto out; 926 goto out;
927 927
928 if ((hard_iface->soft_iface) && 928 if (hard_iface->soft_iface &&
929 (strncmp(hard_iface->soft_iface->name, ifname, IFNAMSIZ) == 0)) 929 strncmp(hard_iface->soft_iface->name, ifname, IFNAMSIZ) == 0)
930 goto out; 930 goto out;
931 931
932 if (status_tmp == BATADV_IF_NOT_IN_USE) { 932 if (status_tmp == BATADV_IF_NOT_IN_USE) {
diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c
index bfe8effe9238..4b90033f35a8 100644
--- a/net/batman-adv/tp_meter.c
+++ b/net/batman-adv/tp_meter.c
@@ -1206,7 +1206,7 @@ static int batadv_tp_send_ack(struct batadv_priv *bat_priv, const u8 *dst,
1206 1206
1207 /* send the ack */ 1207 /* send the ack */
1208 r = batadv_send_skb_to_orig(skb, orig_node, NULL); 1208 r = batadv_send_skb_to_orig(skb, orig_node, NULL);
1209 if (unlikely(r < 0) || (r == NET_XMIT_DROP)) { 1209 if (unlikely(r < 0) || r == NET_XMIT_DROP) {
1210 ret = BATADV_TP_REASON_DST_UNREACHABLE; 1210 ret = BATADV_TP_REASON_DST_UNREACHABLE;
1211 goto out; 1211 goto out;
1212 } 1212 }