aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/batman-adv/bat_sysfs.c4
-rw-r--r--net/batman-adv/bitarray.c8
-rw-r--r--net/batman-adv/gateway_client.c2
-rw-r--r--net/batman-adv/gateway_common.c4
-rw-r--r--net/batman-adv/hard-interface.c30
-rw-r--r--net/batman-adv/originator.c5
-rw-r--r--net/batman-adv/routing.c8
-rw-r--r--net/batman-adv/soft-interface.c2
-rw-r--r--net/batman-adv/translation-table.c26
9 files changed, 44 insertions, 45 deletions
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c
index 7317729a00f7..b00101db5cc6 100644
--- a/net/batman-adv/bat_sysfs.c
+++ b/net/batman-adv/bat_sysfs.c
@@ -321,11 +321,11 @@ static ssize_t store_gw_mode(struct kobject *kobj, struct attribute *attr,
321 gw_mode_tmp = GW_MODE_OFF; 321 gw_mode_tmp = GW_MODE_OFF;
322 322
323 if (strncmp(buff, GW_MODE_CLIENT_NAME, 323 if (strncmp(buff, GW_MODE_CLIENT_NAME,
324 strlen(GW_MODE_CLIENT_NAME)) == 0) 324 strlen(GW_MODE_CLIENT_NAME)) == 0)
325 gw_mode_tmp = GW_MODE_CLIENT; 325 gw_mode_tmp = GW_MODE_CLIENT;
326 326
327 if (strncmp(buff, GW_MODE_SERVER_NAME, 327 if (strncmp(buff, GW_MODE_SERVER_NAME,
328 strlen(GW_MODE_SERVER_NAME)) == 0) 328 strlen(GW_MODE_SERVER_NAME)) == 0)
329 gw_mode_tmp = GW_MODE_SERVER; 329 gw_mode_tmp = GW_MODE_SERVER;
330 330
331 if (gw_mode_tmp < 0) { 331 if (gw_mode_tmp < 0) {
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c
index e63069d61dbb..6d0aa216b232 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -154,8 +154,8 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
154 154
155 /* sequence number is much newer, probably missed a lot of packets */ 155 /* sequence number is much newer, probably missed a lot of packets */
156 156
157 if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) 157 if ((seq_num_diff >= TQ_LOCAL_WINDOW_SIZE) &&
158 && (seq_num_diff < EXPECTED_SEQNO_RANGE)) { 158 (seq_num_diff < EXPECTED_SEQNO_RANGE)) {
159 bat_dbg(DBG_BATMAN, bat_priv, 159 bat_dbg(DBG_BATMAN, bat_priv,
160 "We missed a lot of packets (%i) !\n", 160 "We missed a lot of packets (%i) !\n",
161 seq_num_diff - 1); 161 seq_num_diff - 1);
@@ -170,8 +170,8 @@ int bit_get_packet(void *priv, unsigned long *seq_bits,
170 * packet should be dropped without calling this function if the 170 * packet should be dropped without calling this function if the
171 * seqno window is protected. */ 171 * seqno window is protected. */
172 172
173 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) 173 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
174 || (seq_num_diff >= EXPECTED_SEQNO_RANGE)) { 174 (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
175 175
176 bat_dbg(DBG_BATMAN, bat_priv, 176 bat_dbg(DBG_BATMAN, bat_priv,
177 "Other host probably restarted!\n"); 177 "Other host probably restarted!\n");
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 65a77a10f17d..0fa8e2d7c46e 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -629,7 +629,7 @@ bool gw_is_dhcp_target(struct sk_buff *skb, unsigned int *header_len)
629 629
630 /* check for bootp port */ 630 /* check for bootp port */
631 if ((ntohs(ethhdr->h_proto) == ETH_P_IP) && 631 if ((ntohs(ethhdr->h_proto) == ETH_P_IP) &&
632 (ntohs(udphdr->dest) != 67)) 632 (ntohs(udphdr->dest) != 67))
633 return false; 633 return false;
634 634
635 if ((ntohs(ethhdr->h_proto) == ETH_P_IPV6) && 635 if ((ntohs(ethhdr->h_proto) == ETH_P_IPV6) &&
diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c
index 7f79e156e64d..3ccb9c87fd19 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -93,7 +93,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
93 multi = 1024; 93 multi = 1024;
94 94
95 if ((strnicmp(tmp_ptr, "kbit", 4) == 0) || 95 if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
96 (multi > 1)) 96 (multi > 1))
97 *tmp_ptr = '\0'; 97 *tmp_ptr = '\0';
98 } 98 }
99 99
@@ -118,7 +118,7 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
118 multi = 1024; 118 multi = 1024;
119 119
120 if ((strnicmp(tmp_ptr, "kbit", 4) == 0) || 120 if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
121 (multi > 1)) 121 (multi > 1))
122 *tmp_ptr = '\0'; 122 *tmp_ptr = '\0';
123 } 123 }
124 124
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 41826b96d9f1..409d0273c9d1 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -341,23 +341,23 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
341 if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < 341 if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
342 ETH_DATA_LEN + BAT_HEADER_LEN) 342 ETH_DATA_LEN + BAT_HEADER_LEN)
343 bat_info(hard_iface->soft_iface, 343 bat_info(hard_iface->soft_iface,
344 "The MTU of interface %s is too small (%i) to handle " 344 "The MTU of interface %s is too small (%i) to handle "
345 "the transport of batman-adv packets. Packets going " 345 "the transport of batman-adv packets. Packets going "
346 "over this interface will be fragmented on layer2 " 346 "over this interface will be fragmented on layer2 "
347 "which could impact the performance. Setting the MTU " 347 "which could impact the performance. Setting the MTU "
348 "to %zi would solve the problem.\n", 348 "to %zi would solve the problem.\n",
349 hard_iface->net_dev->name, hard_iface->net_dev->mtu, 349 hard_iface->net_dev->name, hard_iface->net_dev->mtu,
350 ETH_DATA_LEN + BAT_HEADER_LEN); 350 ETH_DATA_LEN + BAT_HEADER_LEN);
351 351
352 if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < 352 if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
353 ETH_DATA_LEN + BAT_HEADER_LEN) 353 ETH_DATA_LEN + BAT_HEADER_LEN)
354 bat_info(hard_iface->soft_iface, 354 bat_info(hard_iface->soft_iface,
355 "The MTU of interface %s is too small (%i) to handle " 355 "The MTU of interface %s is too small (%i) to handle "
356 "the transport of batman-adv packets. If you experience" 356 "the transport of batman-adv packets. If you "
357 " problems getting traffic through try increasing the " 357 "experience problems getting traffic through try "
358 "MTU to %zi.\n", 358 "increasing the MTU to %zi.\n",
359 hard_iface->net_dev->name, hard_iface->net_dev->mtu, 359 hard_iface->net_dev->name, hard_iface->net_dev->mtu,
360 ETH_DATA_LEN + BAT_HEADER_LEN); 360 ETH_DATA_LEN + BAT_HEADER_LEN);
361 361
362 if (hardif_is_iface_up(hard_iface)) 362 if (hardif_is_iface_up(hard_iface))
363 hardif_activate_interface(hard_iface); 363 hardif_activate_interface(hard_iface);
@@ -580,8 +580,8 @@ static int batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
580 goto err_free; 580 goto err_free;
581 581
582 /* expect a valid ethernet header here. */ 582 /* expect a valid ethernet header here. */
583 if (unlikely(skb->mac_len != sizeof(struct ethhdr) 583 if (unlikely(skb->mac_len != sizeof(struct ethhdr) ||
584 || !skb_mac_header(skb))) 584 !skb_mac_header(skb)))
585 goto err_free; 585 goto err_free;
586 586
587 if (!hard_iface->soft_iface) 587 if (!hard_iface->soft_iface)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index c2e46b551624..371cc93d8e17 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -143,7 +143,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
143 143
144 frag_list_free(&orig_node->frag_list); 144 frag_list_free(&orig_node->frag_list);
145 tt_global_del_orig(orig_node->bat_priv, orig_node, 145 tt_global_del_orig(orig_node->bat_priv, orig_node,
146 "originator timed out"); 146 "originator timed out");
147 147
148 kfree(orig_node->tt_buff); 148 kfree(orig_node->tt_buff);
149 kfree(orig_node->bcast_own); 149 kfree(orig_node->bcast_own);
@@ -333,9 +333,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
333 return true; 333 return true;
334 } else { 334 } else {
335 if (purge_orig_neighbors(bat_priv, orig_node, 335 if (purge_orig_neighbors(bat_priv, orig_node,
336 &best_neigh_node)) { 336 &best_neigh_node))
337 update_route(bat_priv, orig_node, best_neigh_node); 337 update_route(bat_priv, orig_node, best_neigh_node);
338 }
339 } 338 }
340 339
341 return false; 340 return false;
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index cf9a2f62de6a..f53515562a4f 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -72,7 +72,7 @@ static void _update_route(struct bat_priv *bat_priv,
72 bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n", 72 bat_dbg(DBG_ROUTES, bat_priv, "Deleting route towards: %pM\n",
73 orig_node->orig); 73 orig_node->orig);
74 tt_global_del_orig(bat_priv, orig_node, 74 tt_global_del_orig(bat_priv, orig_node,
75 "Deleted route towards originator"); 75 "Deleted route towards originator");
76 76
77 /* route added */ 77 /* route added */
78 } else if ((!curr_router) && (neigh_node)) { 78 } else if ((!curr_router) && (neigh_node)) {
@@ -229,8 +229,8 @@ void bonding_save_primary(const struct orig_node *orig_node,
229int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, 229int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
230 unsigned long *last_reset) 230 unsigned long *last_reset)
231{ 231{
232 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) 232 if ((seq_num_diff <= -TQ_LOCAL_WINDOW_SIZE) ||
233 || (seq_num_diff >= EXPECTED_SEQNO_RANGE)) { 233 (seq_num_diff >= EXPECTED_SEQNO_RANGE)) {
234 if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) { 234 if (has_timed_out(*last_reset, RESET_PROTECTION_MS)) {
235 235
236 *last_reset = jiffies; 236 *last_reset = jiffies;
@@ -429,7 +429,7 @@ int recv_icmp_packet(struct sk_buff *skb, struct hard_iface *recv_if)
429 if ((hdr_size == sizeof(struct icmp_packet_rr)) && 429 if ((hdr_size == sizeof(struct icmp_packet_rr)) &&
430 (icmp_packet->rr_cur < BAT_RR_LEN)) { 430 (icmp_packet->rr_cur < BAT_RR_LEN)) {
431 memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]), 431 memcpy(&(icmp_packet->rr[icmp_packet->rr_cur]),
432 ethhdr->h_dest, ETH_ALEN); 432 ethhdr->h_dest, ETH_ALEN);
433 icmp_packet->rr_cur++; 433 icmp_packet->rr_cur++;
434 } 434 }
435 435
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 2ffdc74ac40e..c39c120e1171 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -397,7 +397,7 @@ void softif_neigh_purge(struct bat_priv *bat_priv)
397 &softif_neigh_vid->softif_neigh_list, 397 &softif_neigh_vid->softif_neigh_list,
398 list) { 398 list) {
399 if ((!has_timed_out(softif_neigh->last_seen, 399 if ((!has_timed_out(softif_neigh->last_seen,
400 SOFTIF_NEIGH_TIMEOUT)) && 400 SOFTIF_NEIGH_TIMEOUT)) &&
401 (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE)) 401 (atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE))
402 continue; 402 continue;
403 403
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 9a6f315b7d44..c9507057c98e 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -261,7 +261,7 @@ int tt_changes_fill_buffer(struct bat_priv *bat_priv,
261 atomic_set(&bat_priv->tt_local_changes, 0); 261 atomic_set(&bat_priv->tt_local_changes, 0);
262 262
263 list_for_each_entry_safe(entry, safe, &bat_priv->tt_changes_list, 263 list_for_each_entry_safe(entry, safe, &bat_priv->tt_changes_list,
264 list) { 264 list) {
265 if (count < tot_changes) { 265 if (count < tot_changes) {
266 memcpy(buff + tt_len(count), 266 memcpy(buff + tt_len(count),
267 &entry->change, sizeof(struct tt_change)); 267 &entry->change, sizeof(struct tt_change));
@@ -333,17 +333,17 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset)
333 hlist_for_each_entry_rcu(tt_common_entry, node, 333 hlist_for_each_entry_rcu(tt_common_entry, node,
334 head, hash_entry) { 334 head, hash_entry) {
335 seq_printf(seq, " * %pM [%c%c%c%c%c]\n", 335 seq_printf(seq, " * %pM [%c%c%c%c%c]\n",
336 tt_common_entry->addr, 336 tt_common_entry->addr,
337 (tt_common_entry->flags & 337 (tt_common_entry->flags &
338 TT_CLIENT_ROAM ? 'R' : '.'), 338 TT_CLIENT_ROAM ? 'R' : '.'),
339 (tt_common_entry->flags & 339 (tt_common_entry->flags &
340 TT_CLIENT_NOPURGE ? 'P' : '.'), 340 TT_CLIENT_NOPURGE ? 'P' : '.'),
341 (tt_common_entry->flags & 341 (tt_common_entry->flags &
342 TT_CLIENT_NEW ? 'N' : '.'), 342 TT_CLIENT_NEW ? 'N' : '.'),
343 (tt_common_entry->flags & 343 (tt_common_entry->flags &
344 TT_CLIENT_PENDING ? 'X' : '.'), 344 TT_CLIENT_PENDING ? 'X' : '.'),
345 (tt_common_entry->flags & 345 (tt_common_entry->flags &
346 TT_CLIENT_WIFI ? 'W' : '.')); 346 TT_CLIENT_WIFI ? 'W' : '.'));
347 } 347 }
348 rcu_read_unlock(); 348 rcu_read_unlock();
349 } 349 }
@@ -704,7 +704,7 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
704 704
705 spin_lock_bh(list_lock); 705 spin_lock_bh(list_lock);
706 hlist_for_each_entry_safe(tt_common_entry, node, safe, 706 hlist_for_each_entry_safe(tt_common_entry, node, safe,
707 head, hash_entry) { 707 head, hash_entry) {
708 tt_global_entry = container_of(tt_common_entry, 708 tt_global_entry = container_of(tt_common_entry,
709 struct tt_global_entry, 709 struct tt_global_entry,
710 common); 710 common);