aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-03-11 18:36:34 -0400
committerDavid S. Miller <davem@davemloft.net>2012-03-11 18:36:34 -0400
commite8abbe0d0236ac1d55d21fec7a8d2ee03e9d3258 (patch)
tree222115ab13209862ffdf35c11c9f7923a059188c /net/batman-adv
parentbb092c0db883d435d9d774e10b4cf71f12aad122 (diff)
parent40e0c4f51d3fc3fd54edc797adae314fbe2b96a6 (diff)
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bat_iv_ogm.c57
-rw-r--r--net/batman-adv/bat_sysfs.c16
-rw-r--r--net/batman-adv/gateway_client.c31
-rw-r--r--net/batman-adv/gateway_common.c8
-rw-r--r--net/batman-adv/hard-interface.c36
-rw-r--r--net/batman-adv/icmp_socket.c12
-rw-r--r--net/batman-adv/main.c8
-rw-r--r--net/batman-adv/main.h13
-rw-r--r--net/batman-adv/originator.c14
-rw-r--r--net/batman-adv/routing.c30
-rw-r--r--net/batman-adv/send.c6
-rw-r--r--net/batman-adv/soft-interface.c15
-rw-r--r--net/batman-adv/translation-table.c89
-rw-r--r--net/batman-adv/unicast.c4
14 files changed, 145 insertions, 194 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 2b66daef1ef6..a6d5d63fb6ad 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -132,8 +132,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet,
132 "Sending own" : 132 "Sending own" :
133 "Forwarding")); 133 "Forwarding"));
134 bat_dbg(DBG_BATMAN, bat_priv, 134 bat_dbg(DBG_BATMAN, bat_priv,
135 "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d," 135 "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d, IDF %s, ttvn %d) on interface %s [%pM]\n",
136 " IDF %s, ttvn %d) on interface %s [%pM]\n",
137 fwd_str, (packet_num > 0 ? "aggregated " : ""), 136 fwd_str, (packet_num > 0 ? "aggregated " : ""),
138 batman_ogm_packet->orig, 137 batman_ogm_packet->orig,
139 ntohl(batman_ogm_packet->seqno), 138 ntohl(batman_ogm_packet->seqno),
@@ -171,8 +170,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
171 directlink = (batman_ogm_packet->flags & DIRECTLINK ? 1 : 0); 170 directlink = (batman_ogm_packet->flags & DIRECTLINK ? 1 : 0);
172 171
173 if (!forw_packet->if_incoming) { 172 if (!forw_packet->if_incoming) {
174 pr_err("Error - can't forward packet: incoming iface not " 173 pr_err("Error - can't forward packet: incoming iface not specified\n");
175 "specified\n");
176 goto out; 174 goto out;
177 } 175 }
178 176
@@ -193,8 +191,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
193 191
194 /* FIXME: what about aggregated packets ? */ 192 /* FIXME: what about aggregated packets ? */
195 bat_dbg(DBG_BATMAN, bat_priv, 193 bat_dbg(DBG_BATMAN, bat_priv,
196 "%s packet (originator %pM, seqno %d, TTL %d) " 194 "%s packet (originator %pM, seqno %d, TTL %d) on interface %s [%pM]\n",
197 "on interface %s [%pM]\n",
198 (forw_packet->own ? "Sending own" : "Forwarding"), 195 (forw_packet->own ? "Sending own" : "Forwarding"),
199 batman_ogm_packet->orig, 196 batman_ogm_packet->orig,
200 ntohl(batman_ogm_packet->seqno), 197 ntohl(batman_ogm_packet->seqno),
@@ -508,8 +505,7 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node,
508 batman_ogm_packet->tq = hop_penalty(batman_ogm_packet->tq, bat_priv); 505 batman_ogm_packet->tq = hop_penalty(batman_ogm_packet->tq, bat_priv);
509 506
510 bat_dbg(DBG_BATMAN, bat_priv, 507 bat_dbg(DBG_BATMAN, bat_priv,
511 "Forwarding packet: tq_orig: %i, tq_avg: %i, " 508 "Forwarding packet: tq_orig: %i, tq_avg: %i, tq_forw: %i, ttl_orig: %i, ttl_forw: %i\n",
512 "tq_forw: %i, ttl_orig: %i, ttl_forw: %i\n",
513 in_tq, tq_avg, batman_ogm_packet->tq, in_ttl - 1, 509 in_tq, tq_avg, batman_ogm_packet->tq, in_ttl - 1,
514 batman_ogm_packet->header.ttl); 510 batman_ogm_packet->header.ttl);
515 511
@@ -589,8 +585,8 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
589 struct hlist_node *node; 585 struct hlist_node *node;
590 uint8_t bcast_own_sum_orig, bcast_own_sum_neigh; 586 uint8_t bcast_own_sum_orig, bcast_own_sum_neigh;
591 587
592 bat_dbg(DBG_BATMAN, bat_priv, "update_originator(): " 588 bat_dbg(DBG_BATMAN, bat_priv,
593 "Searching and updating originator entry of received packet\n"); 589 "update_originator(): Searching and updating originator entry of received packet\n");
594 590
595 rcu_read_lock(); 591 rcu_read_lock();
596 hlist_for_each_entry_rcu(tmp_neigh_node, node, 592 hlist_for_each_entry_rcu(tmp_neigh_node, node,
@@ -783,8 +779,7 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
783 * information */ 779 * information */
784 tq_own = (TQ_MAX_VALUE * total_count) / neigh_rq_count; 780 tq_own = (TQ_MAX_VALUE * total_count) / neigh_rq_count;
785 781
786 /* 782 /* 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
787 * 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does
788 * affect the nearly-symmetric links only a little, but 783 * affect the nearly-symmetric links only a little, but
789 * punishes asymmetric links more. This will give a value 784 * punishes asymmetric links more. This will give a value
790 * between 0 and TQ_MAX_VALUE 785 * between 0 and TQ_MAX_VALUE
@@ -802,10 +797,7 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node,
802 (TQ_MAX_VALUE * TQ_MAX_VALUE)); 797 (TQ_MAX_VALUE * TQ_MAX_VALUE));
803 798
804 bat_dbg(DBG_BATMAN, bat_priv, 799 bat_dbg(DBG_BATMAN, bat_priv,
805 "bidirectional: " 800 "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i\n",
806 "orig = %-15pM neigh = %-15pM => own_bcast = %2i, "
807 "real recv = %2i, local tq: %3i, asym_penalty: %3i, "
808 "total tq: %3i\n",
809 orig_node->orig, orig_neigh_node->orig, total_count, 801 orig_node->orig, orig_neigh_node->orig, total_count,
810 neigh_rq_count, tq_own, tq_asym_penalty, batman_ogm_packet->tq); 802 neigh_rq_count, tq_own, tq_asym_penalty, batman_ogm_packet->tq);
811 803
@@ -933,9 +925,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
933 batman_ogm_packet->orig) ? 1 : 0); 925 batman_ogm_packet->orig) ? 1 : 0);
934 926
935 bat_dbg(DBG_BATMAN, bat_priv, 927 bat_dbg(DBG_BATMAN, bat_priv,
936 "Received BATMAN packet via NB: %pM, IF: %s [%pM] " 928 "Received BATMAN packet via NB: %pM, IF: %s [%pM] (from OG: %pM, via prev OG: %pM, seqno %d, ttvn %u, crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n",
937 "(from OG: %pM, via prev OG: %pM, seqno %d, ttvn %u, "
938 "crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n",
939 ethhdr->h_source, if_incoming->net_dev->name, 929 ethhdr->h_source, if_incoming->net_dev->name,
940 if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, 930 if_incoming->net_dev->dev_addr, batman_ogm_packet->orig,
941 batman_ogm_packet->prev_sender, batman_ogm_packet->seqno, 931 batman_ogm_packet->prev_sender, batman_ogm_packet->seqno,
@@ -978,16 +968,15 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
978 968
979 if (is_my_addr) { 969 if (is_my_addr) {
980 bat_dbg(DBG_BATMAN, bat_priv, 970 bat_dbg(DBG_BATMAN, bat_priv,
981 "Drop packet: received my own broadcast (sender: %pM" 971 "Drop packet: received my own broadcast (sender: %pM)\n",
982 ")\n",
983 ethhdr->h_source); 972 ethhdr->h_source);
984 return; 973 return;
985 } 974 }
986 975
987 if (is_broadcast) { 976 if (is_broadcast) {
988 bat_dbg(DBG_BATMAN, bat_priv, "Drop packet: " 977 bat_dbg(DBG_BATMAN, bat_priv,
989 "ignoring all packets with broadcast source addr (sender: %pM" 978 "Drop packet: ignoring all packets with broadcast source addr (sender: %pM)\n",
990 ")\n", ethhdr->h_source); 979 ethhdr->h_source);
991 return; 980 return;
992 } 981 }
993 982
@@ -1017,16 +1006,16 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1017 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); 1006 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
1018 } 1007 }
1019 1008
1020 bat_dbg(DBG_BATMAN, bat_priv, "Drop packet: " 1009 bat_dbg(DBG_BATMAN, bat_priv,
1021 "originator packet from myself (via neighbor)\n"); 1010 "Drop packet: originator packet from myself (via neighbor)\n");
1022 orig_node_free_ref(orig_neigh_node); 1011 orig_node_free_ref(orig_neigh_node);
1023 return; 1012 return;
1024 } 1013 }
1025 1014
1026 if (is_my_oldorig) { 1015 if (is_my_oldorig) {
1027 bat_dbg(DBG_BATMAN, bat_priv, 1016 bat_dbg(DBG_BATMAN, bat_priv,
1028 "Drop packet: ignoring all rebroadcast echos (sender: " 1017 "Drop packet: ignoring all rebroadcast echos (sender: %pM)\n",
1029 "%pM)\n", ethhdr->h_source); 1018 ethhdr->h_source);
1030 return; 1019 return;
1031 } 1020 }
1032 1021
@@ -1039,8 +1028,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1039 1028
1040 if (is_duplicate == -1) { 1029 if (is_duplicate == -1) {
1041 bat_dbg(DBG_BATMAN, bat_priv, 1030 bat_dbg(DBG_BATMAN, bat_priv,
1042 "Drop packet: packet within seqno protection time " 1031 "Drop packet: packet within seqno protection time (sender: %pM)\n",
1043 "(sender: %pM)\n", ethhdr->h_source); 1032 ethhdr->h_source);
1044 goto out; 1033 goto out;
1045 } 1034 }
1046 1035
@@ -1061,8 +1050,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1061 batman_ogm_packet->prev_sender)) && 1050 batman_ogm_packet->prev_sender)) &&
1062 (compare_eth(router->addr, router_router->addr))) { 1051 (compare_eth(router->addr, router_router->addr))) {
1063 bat_dbg(DBG_BATMAN, bat_priv, 1052 bat_dbg(DBG_BATMAN, bat_priv,
1064 "Drop packet: ignoring all rebroadcast packets that " 1053 "Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %pM)\n",
1065 "may make me loop (sender: %pM)\n", ethhdr->h_source); 1054 ethhdr->h_source);
1066 goto out; 1055 goto out;
1067 } 1056 }
1068 1057
@@ -1106,8 +1095,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1106 bat_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet, 1095 bat_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet,
1107 1, if_incoming); 1096 1, if_incoming);
1108 1097
1109 bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " 1098 bat_dbg(DBG_BATMAN, bat_priv,
1110 "rebroadcast neighbor packet with direct link flag\n"); 1099 "Forwarding packet: rebroadcast neighbor packet with direct link flag\n");
1111 goto out_neigh; 1100 goto out_neigh;
1112 } 1101 }
1113 1102
diff --git a/net/batman-adv/bat_sysfs.c b/net/batman-adv/bat_sysfs.c
index b00101db5cc6..68ff759fc304 100644
--- a/net/batman-adv/bat_sysfs.c
+++ b/net/batman-adv/bat_sysfs.c
@@ -255,8 +255,8 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
255 buff[count - 1] = '\0'; 255 buff[count - 1] = '\0';
256 256
257 bat_info(net_dev, 257 bat_info(net_dev,
258 "Invalid parameter for 'vis mode' setting received: " 258 "Invalid parameter for 'vis mode' setting received: %s\n",
259 "%s\n", buff); 259 buff);
260 return -EINVAL; 260 return -EINVAL;
261 } 261 }
262 262
@@ -330,8 +330,8 @@ static ssize_t store_gw_mode(struct kobject *kobj, struct attribute *attr,
330 330
331 if (gw_mode_tmp < 0) { 331 if (gw_mode_tmp < 0) {
332 bat_info(net_dev, 332 bat_info(net_dev,
333 "Invalid parameter for 'gw mode' setting received: " 333 "Invalid parameter for 'gw mode' setting received: %s\n",
334 "%s\n", buff); 334 buff);
335 return -EINVAL; 335 return -EINVAL;
336 } 336 }
337 337
@@ -502,8 +502,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
502 buff[count - 1] = '\0'; 502 buff[count - 1] = '\0';
503 503
504 if (strlen(buff) >= IFNAMSIZ) { 504 if (strlen(buff) >= IFNAMSIZ) {
505 pr_err("Invalid parameter for 'mesh_iface' setting received: " 505 pr_err("Invalid parameter for 'mesh_iface' setting received: interface name too long '%s'\n",
506 "interface name too long '%s'\n", buff); 506 buff);
507 hardif_free_ref(hard_iface); 507 hardif_free_ref(hard_iface);
508 return -EINVAL; 508 return -EINVAL;
509 } 509 }
@@ -677,8 +677,8 @@ out:
677 hardif_free_ref(primary_if); 677 hardif_free_ref(primary_if);
678 678
679 if (ret) 679 if (ret)
680 bat_dbg(DBG_BATMAN, bat_priv, "Impossible to send " 680 bat_dbg(DBG_BATMAN, bat_priv,
681 "uevent for (%s,%s,%s) event (err: %d)\n", 681 "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n",
682 uev_type_str[type], uev_action_str[action], 682 uev_type_str[type], uev_action_str[action],
683 (action == UEV_DEL ? "NULL" : data), ret); 683 (action == UEV_DEL ? "NULL" : data), ret);
684 return ret; 684 return ret;
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 0fa8e2d7c46e..6f9b9b78f77d 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -224,16 +224,13 @@ void gw_election(struct bat_priv *bat_priv)
224 } else if ((!curr_gw) && (next_gw)) { 224 } else if ((!curr_gw) && (next_gw)) {
225 bat_dbg(DBG_BATMAN, bat_priv, 225 bat_dbg(DBG_BATMAN, bat_priv,
226 "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", 226 "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n",
227 next_gw->orig_node->orig, 227 next_gw->orig_node->orig, next_gw->orig_node->gw_flags,
228 next_gw->orig_node->gw_flags,
229 router->tq_avg); 228 router->tq_avg);
230 throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); 229 throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr);
231 } else { 230 } else {
232 bat_dbg(DBG_BATMAN, bat_priv, 231 bat_dbg(DBG_BATMAN, bat_priv,
233 "Changing route to gateway %pM " 232 "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n",
234 "(gw_flags: %i, tq: %i)\n", 233 next_gw->orig_node->orig, next_gw->orig_node->gw_flags,
235 next_gw->orig_node->orig,
236 next_gw->orig_node->gw_flags,
237 router->tq_avg); 234 router->tq_avg);
238 throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); 235 throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr);
239 } 236 }
@@ -287,8 +284,7 @@ void gw_check_election(struct bat_priv *bat_priv, struct orig_node *orig_node)
287 goto out; 284 goto out;
288 285
289 bat_dbg(DBG_BATMAN, bat_priv, 286 bat_dbg(DBG_BATMAN, bat_priv,
290 "Restarting gateway selection: better gateway found (tq curr: " 287 "Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n",
291 "%i, tq new: %i)\n",
292 gw_tq_avg, orig_tq_avg); 288 gw_tq_avg, orig_tq_avg);
293 289
294deselect: 290deselect:
@@ -352,8 +348,7 @@ void gw_node_update(struct bat_priv *bat_priv,
352 continue; 348 continue;
353 349
354 bat_dbg(DBG_BATMAN, bat_priv, 350 bat_dbg(DBG_BATMAN, bat_priv,
355 "Gateway class of originator %pM changed from " 351 "Gateway class of originator %pM changed from %i to %i\n",
356 "%i to %i\n",
357 orig_node->orig, gw_node->orig_node->gw_flags, 352 orig_node->orig, gw_node->orig_node->gw_flags,
358 new_gwflags); 353 new_gwflags);
359 354
@@ -474,23 +469,23 @@ int gw_client_seq_print_text(struct seq_file *seq, void *offset)
474 469
475 primary_if = primary_if_get_selected(bat_priv); 470 primary_if = primary_if_get_selected(bat_priv);
476 if (!primary_if) { 471 if (!primary_if) {
477 ret = seq_printf(seq, "BATMAN mesh %s disabled - please " 472 ret = seq_printf(seq,
478 "specify interfaces to enable it\n", 473 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
479 net_dev->name); 474 net_dev->name);
480 goto out; 475 goto out;
481 } 476 }
482 477
483 if (primary_if->if_status != IF_ACTIVE) { 478 if (primary_if->if_status != IF_ACTIVE) {
484 ret = seq_printf(seq, "BATMAN mesh %s disabled - " 479 ret = seq_printf(seq,
485 "primary interface not active\n", 480 "BATMAN mesh %s disabled - primary interface not active\n",
486 net_dev->name); 481 net_dev->name);
487 goto out; 482 goto out;
488 } 483 }
489 484
490 seq_printf(seq, " %-12s (%s/%i) %17s [%10s]: gw_class ... " 485 seq_printf(seq,
491 "[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n", 486 " %-12s (%s/%i) %17s [%10s]: gw_class ... [B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n",
492 "Gateway", "#", TQ_MAX_VALUE, "Nexthop", 487 "Gateway", "#", TQ_MAX_VALUE, "Nexthop", "outgoingIF",
493 "outgoingIF", SOURCE_VERSION, primary_if->net_dev->name, 488 SOURCE_VERSION, primary_if->net_dev->name,
494 primary_if->net_dev->dev_addr, net_dev->name); 489 primary_if->net_dev->dev_addr, net_dev->name);
495 490
496 rcu_read_lock(); 491 rcu_read_lock();
diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c
index 3ccb9c87fd19..ca57ac7d73b2 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -125,8 +125,8 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff,
125 ret = kstrtol(slash_ptr + 1, 10, &lup); 125 ret = kstrtol(slash_ptr + 1, 10, &lup);
126 if (ret) { 126 if (ret) {
127 bat_err(net_dev, 127 bat_err(net_dev,
128 "Upload speed of gateway mode invalid: " 128 "Upload speed of gateway mode invalid: %s\n",
129 "%s\n", slash_ptr + 1); 129 slash_ptr + 1);
130 return false; 130 return false;
131 } 131 }
132 132
@@ -163,8 +163,8 @@ ssize_t gw_bandwidth_set(struct net_device *net_dev, char *buff, size_t count)
163 gw_bandwidth_to_kbit((uint8_t)gw_bandwidth_tmp, &down, &up); 163 gw_bandwidth_to_kbit((uint8_t)gw_bandwidth_tmp, &down, &up);
164 164
165 gw_deselect(bat_priv); 165 gw_deselect(bat_priv);
166 bat_info(net_dev, "Changing gateway bandwidth from: '%i' to: '%ld' " 166 bat_info(net_dev,
167 "(propagating: %d%s/%d%s)\n", 167 "Changing gateway bandwidth from: '%i' to: '%ld' (propagating: %d%s/%d%s)\n",
168 atomic_read(&bat_priv->gw_bandwidth), gw_bandwidth_tmp, 168 atomic_read(&bat_priv->gw_bandwidth), gw_bandwidth_tmp,
169 (down > 2048 ? down / 1024 : down), 169 (down > 2048 ? down / 1024 : down),
170 (down > 2048 ? "MBit" : "KBit"), 170 (down > 2048 ? "MBit" : "KBit"),
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index 409d0273c9d1..377897701a85 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -175,11 +175,9 @@ static void check_known_mac_addr(const struct net_device *net_dev)
175 net_dev->dev_addr)) 175 net_dev->dev_addr))
176 continue; 176 continue;
177 177
178 pr_warning("The newly added mac address (%pM) already exists " 178 pr_warning("The newly added mac address (%pM) already exists on: %s\n",
179 "on: %s\n", net_dev->dev_addr, 179 net_dev->dev_addr, hard_iface->net_dev->name);
180 hard_iface->net_dev->name); 180 pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
181 pr_warning("It is strongly recommended to keep mac addresses "
182 "unique to avoid problems!\n");
183 } 181 }
184 rcu_read_unlock(); 182 rcu_read_unlock();
185} 183}
@@ -282,10 +280,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
282 280
283 /* hard-interface is part of a bridge */ 281 /* hard-interface is part of a bridge */
284 if (hard_iface->net_dev->priv_flags & IFF_BRIDGE_PORT) 282 if (hard_iface->net_dev->priv_flags & IFF_BRIDGE_PORT)
285 pr_err("You are about to enable batman-adv on '%s' which " 283 pr_err("You are about to enable batman-adv on '%s' which already is part of a bridge. Unless you know exactly what you are doing this is probably wrong and won't work the way you think it would.\n",
286 "already is part of a bridge. Unless you know exactly "
287 "what you are doing this is probably wrong and won't "
288 "work the way you think it would.\n",
289 hard_iface->net_dev->name); 284 hard_iface->net_dev->name);
290 285
291 soft_iface = dev_get_by_name(&init_net, iface_name); 286 soft_iface = dev_get_by_name(&init_net, iface_name);
@@ -303,8 +298,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
303 } 298 }
304 299
305 if (!softif_is_valid(soft_iface)) { 300 if (!softif_is_valid(soft_iface)) {
306 pr_err("Can't create batman mesh interface %s: " 301 pr_err("Can't create batman mesh interface %s: already exists as regular interface\n",
307 "already exists as regular interface\n",
308 soft_iface->name); 302 soft_iface->name);
309 dev_put(soft_iface); 303 dev_put(soft_iface);
310 ret = -EINVAL; 304 ret = -EINVAL;
@@ -317,8 +311,9 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
317 bat_priv->bat_algo_ops->bat_ogm_init(hard_iface); 311 bat_priv->bat_algo_ops->bat_ogm_init(hard_iface);
318 312
319 if (!hard_iface->packet_buff) { 313 if (!hard_iface->packet_buff) {
320 bat_err(hard_iface->soft_iface, "Can't add interface packet " 314 bat_err(hard_iface->soft_iface,
321 "(%s): out of memory\n", hard_iface->net_dev->name); 315 "Can't add interface packet (%s): out of memory\n",
316 hard_iface->net_dev->name);
322 ret = -ENOMEM; 317 ret = -ENOMEM;
323 goto err; 318 goto err;
324 } 319 }
@@ -341,29 +336,22 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
341 if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < 336 if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
342 ETH_DATA_LEN + BAT_HEADER_LEN) 337 ETH_DATA_LEN + BAT_HEADER_LEN)
343 bat_info(hard_iface->soft_iface, 338 bat_info(hard_iface->soft_iface,
344 "The MTU of interface %s is too small (%i) to handle " 339 "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %zi would solve the problem.\n",
345 "the transport of batman-adv packets. Packets going "
346 "over this interface will be fragmented on layer2 "
347 "which could impact the performance. Setting the MTU "
348 "to %zi would solve the problem.\n",
349 hard_iface->net_dev->name, hard_iface->net_dev->mtu, 340 hard_iface->net_dev->name, hard_iface->net_dev->mtu,
350 ETH_DATA_LEN + BAT_HEADER_LEN); 341 ETH_DATA_LEN + BAT_HEADER_LEN);
351 342
352 if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < 343 if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu <
353 ETH_DATA_LEN + BAT_HEADER_LEN) 344 ETH_DATA_LEN + BAT_HEADER_LEN)
354 bat_info(hard_iface->soft_iface, 345 bat_info(hard_iface->soft_iface,
355 "The MTU of interface %s is too small (%i) to handle " 346 "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %zi.\n",
356 "the transport of batman-adv packets. If you "
357 "experience problems getting traffic through try "
358 "increasing the MTU to %zi.\n",
359 hard_iface->net_dev->name, hard_iface->net_dev->mtu, 347 hard_iface->net_dev->name, hard_iface->net_dev->mtu,
360 ETH_DATA_LEN + BAT_HEADER_LEN); 348 ETH_DATA_LEN + BAT_HEADER_LEN);
361 349
362 if (hardif_is_iface_up(hard_iface)) 350 if (hardif_is_iface_up(hard_iface))
363 hardif_activate_interface(hard_iface); 351 hardif_activate_interface(hard_iface);
364 else 352 else
365 bat_err(hard_iface->soft_iface, "Not using interface %s " 353 bat_err(hard_iface->soft_iface,
366 "(retrying later): interface not active\n", 354 "Not using interface %s (retrying later): interface not active\n",
367 hard_iface->net_dev->name); 355 hard_iface->net_dev->name);
368 356
369 /* begin scheduling originator messages on that interface */ 357 /* begin scheduling originator messages on that interface */
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 9b755f9eb182..b87518edcef9 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -59,8 +59,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
59 } 59 }
60 60
61 if (i == ARRAY_SIZE(socket_client_hash)) { 61 if (i == ARRAY_SIZE(socket_client_hash)) {
62 pr_err("Error - can't add another packet client: " 62 pr_err("Error - can't add another packet client: maximum number of clients reached\n");
63 "maximum number of clients reached\n");
64 kfree(socket_client); 63 kfree(socket_client);
65 return -EXFULL; 64 return -EXFULL;
66 } 65 }
@@ -162,8 +161,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
162 161
163 if (len < sizeof(struct icmp_packet)) { 162 if (len < sizeof(struct icmp_packet)) {
164 bat_dbg(DBG_BATMAN, bat_priv, 163 bat_dbg(DBG_BATMAN, bat_priv,
165 "Error - can't send packet from char device: " 164 "Error - can't send packet from char device: invalid packet size\n");
166 "invalid packet size\n");
167 return -EINVAL; 165 return -EINVAL;
168 } 166 }
169 167
@@ -193,16 +191,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
193 191
194 if (icmp_packet->header.packet_type != BAT_ICMP) { 192 if (icmp_packet->header.packet_type != BAT_ICMP) {
195 bat_dbg(DBG_BATMAN, bat_priv, 193 bat_dbg(DBG_BATMAN, bat_priv,
196 "Error - can't send packet from char device: " 194 "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n");
197 "got bogus packet type (expected: BAT_ICMP)\n");
198 len = -EINVAL; 195 len = -EINVAL;
199 goto free_skb; 196 goto free_skb;
200 } 197 }
201 198
202 if (icmp_packet->msg_type != ECHO_REQUEST) { 199 if (icmp_packet->msg_type != ECHO_REQUEST) {
203 bat_dbg(DBG_BATMAN, bat_priv, 200 bat_dbg(DBG_BATMAN, bat_priv,
204 "Error - can't send packet from char device: " 201 "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n");
205 "got bogus message type (expected: ECHO_REQUEST)\n");
206 len = -EINVAL; 202 len = -EINVAL;
207 goto free_skb; 203 goto free_skb;
208 } 204 }
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 08f3b3a8e883..6d51caaf8cec 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -64,8 +64,8 @@ static int __init batman_init(void)
64 64
65 register_netdevice_notifier(&hard_if_notifier); 65 register_netdevice_notifier(&hard_if_notifier);
66 66
67 pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) " 67 pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) loaded\n",
68 "loaded\n", SOURCE_VERSION, COMPAT_VERSION); 68 SOURCE_VERSION, COMPAT_VERSION);
69 69
70 return 0; 70 return 0;
71} 71}
@@ -201,8 +201,8 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops)
201 201
202 bat_algo_ops_tmp = bat_algo_get(bat_algo_ops->name); 202 bat_algo_ops_tmp = bat_algo_get(bat_algo_ops->name);
203 if (bat_algo_ops_tmp) { 203 if (bat_algo_ops_tmp) {
204 pr_info("Trying to register already registered routing " 204 pr_info("Trying to register already registered routing algorithm: %s\n",
205 "algorithm: %s\n", bat_algo_ops->name); 205 bat_algo_ops->name);
206 goto out; 206 goto out;
207 } 207 }
208 208
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 1468788a9d64..94fa1c2393a6 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -107,9 +107,7 @@ enum uev_type {
107 107
108#define GW_THRESHOLD 50 108#define GW_THRESHOLD 50
109 109
110/* 110/* Debug Messages */
111 * Debug Messages
112 */
113#ifdef pr_fmt 111#ifdef pr_fmt
114#undef pr_fmt 112#undef pr_fmt
115#endif 113#endif
@@ -124,14 +122,7 @@ enum dbg_level {
124 DBG_ALL = 7 122 DBG_ALL = 7
125}; 123};
126 124
127 125/* Kernel headers */
128/*
129 * Vis
130 */
131
132/*
133 * Kernel headers
134 */
135 126
136#include <linux/mutex.h> /* mutex */ 127#include <linux/mutex.h> /* mutex */
137#include <linux/module.h> /* needed by all modules */ 128#include <linux/module.h> /* needed by all modules */
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 371cc93d8e17..43c0a4f1399e 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -294,14 +294,12 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
294 (neigh_node->if_incoming->if_status == 294 (neigh_node->if_incoming->if_status ==
295 IF_TO_BE_REMOVED)) 295 IF_TO_BE_REMOVED))
296 bat_dbg(DBG_BATMAN, bat_priv, 296 bat_dbg(DBG_BATMAN, bat_priv,
297 "neighbor purge: originator %pM, " 297 "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n",
298 "neighbor: %pM, iface: %s\n",
299 orig_node->orig, neigh_node->addr, 298 orig_node->orig, neigh_node->addr,
300 neigh_node->if_incoming->net_dev->name); 299 neigh_node->if_incoming->net_dev->name);
301 else 300 else
302 bat_dbg(DBG_BATMAN, bat_priv, 301 bat_dbg(DBG_BATMAN, bat_priv,
303 "neighbor timeout: originator %pM, " 302 "neighbor timeout: originator %pM, neighbor: %pM, last_valid: %lu\n",
304 "neighbor: %pM, last_valid: %lu\n",
305 orig_node->orig, neigh_node->addr, 303 orig_node->orig, neigh_node->addr,
306 (neigh_node->last_valid / HZ)); 304 (neigh_node->last_valid / HZ));
307 305
@@ -416,15 +414,15 @@ int orig_seq_print_text(struct seq_file *seq, void *offset)
416 primary_if = primary_if_get_selected(bat_priv); 414 primary_if = primary_if_get_selected(bat_priv);
417 415
418 if (!primary_if) { 416 if (!primary_if) {
419 ret = seq_printf(seq, "BATMAN mesh %s disabled - " 417 ret = seq_printf(seq,
420 "please specify interfaces to enable it\n", 418 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
421 net_dev->name); 419 net_dev->name);
422 goto out; 420 goto out;
423 } 421 }
424 422
425 if (primary_if->if_status != IF_ACTIVE) { 423 if (primary_if->if_status != IF_ACTIVE) {
426 ret = seq_printf(seq, "BATMAN mesh %s " 424 ret = seq_printf(seq,
427 "disabled - primary interface not active\n", 425 "BATMAN mesh %s disabled - primary interface not active\n",
428 net_dev->name); 426 net_dev->name);
429 goto out; 427 goto out;
430 } 428 }
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index f53515562a4f..7f8e15899417 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -83,8 +83,7 @@ static void _update_route(struct bat_priv *bat_priv,
83 /* route changed */ 83 /* route changed */
84 } else if (neigh_node && curr_router) { 84 } else if (neigh_node && curr_router) {
85 bat_dbg(DBG_ROUTES, bat_priv, 85 bat_dbg(DBG_ROUTES, bat_priv,
86 "Changing route towards: %pM " 86 "Changing route towards: %pM (now via %pM - was via %pM)\n",
87 "(now via %pM - was via %pM)\n",
88 orig_node->orig, neigh_node->addr, 87 orig_node->orig, neigh_node->addr,
89 curr_router->addr); 88 curr_router->addr);
90 } 89 }
@@ -238,8 +237,9 @@ int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
238 "old packet received, start protection\n"); 237 "old packet received, start protection\n");
239 238
240 return 0; 239 return 0;
241 } else 240 } else {
242 return 1; 241 return 1;
242 }
243 } 243 }
244 return 0; 244 return 0;
245} 245}
@@ -345,9 +345,8 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
345 345
346 /* send TTL exceeded if packet is an echo request (traceroute) */ 346 /* send TTL exceeded if packet is an echo request (traceroute) */
347 if (icmp_packet->msg_type != ECHO_REQUEST) { 347 if (icmp_packet->msg_type != ECHO_REQUEST) {
348 pr_debug("Warning - can't forward icmp packet from %pM to " 348 pr_debug("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
349 "%pM: ttl exceeded\n", icmp_packet->orig, 349 icmp_packet->orig, icmp_packet->dst);
350 icmp_packet->dst);
351 goto out; 350 goto out;
352 } 351 }
353 352
@@ -674,9 +673,9 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if)
674 if (!orig_node) 673 if (!orig_node)
675 goto out; 674 goto out;
676 675
677 bat_dbg(DBG_TT, bat_priv, "Received ROAMING_ADV from %pM " 676 bat_dbg(DBG_TT, bat_priv,
678 "(client %pM)\n", roam_adv_packet->src, 677 "Received ROAMING_ADV from %pM (client %pM)\n",
679 roam_adv_packet->client); 678 roam_adv_packet->src, roam_adv_packet->client);
680 679
681 tt_global_add(bat_priv, orig_node, roam_adv_packet->client, 680 tt_global_add(bat_priv, orig_node, roam_adv_packet->client,
682 atomic_read(&orig_node->last_ttvn) + 1, true, false); 681 atomic_read(&orig_node->last_ttvn) + 1, true, false);
@@ -813,9 +812,8 @@ int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
813 812
814 /* TTL exceeded */ 813 /* TTL exceeded */
815 if (unicast_packet->header.ttl < 2) { 814 if (unicast_packet->header.ttl < 2) {
816 pr_debug("Warning - can't forward unicast packet from %pM to " 815 pr_debug("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
817 "%pM: ttl exceeded\n", ethhdr->h_source, 816 ethhdr->h_source, unicast_packet->dest);
818 unicast_packet->dest);
819 goto out; 817 goto out;
820 } 818 }
821 819
@@ -934,10 +932,10 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv,
934 orig_node_free_ref(orig_node); 932 orig_node_free_ref(orig_node);
935 } 933 }
936 934
937 bat_dbg(DBG_ROUTES, bat_priv, "TTVN mismatch (old_ttvn %u " 935 bat_dbg(DBG_ROUTES, bat_priv,
938 "new_ttvn %u)! Rerouting unicast packet (for %pM) to " 936 "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n",
939 "%pM\n", unicast_packet->ttvn, curr_ttvn, 937 unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest,
940 ethhdr->h_dest, unicast_packet->dest); 938 unicast_packet->dest);
941 939
942 unicast_packet->ttvn = curr_ttvn; 940 unicast_packet->ttvn = curr_ttvn;
943 } 941 }
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
index 413758065323..af7a6741a685 100644
--- a/net/batman-adv/send.c
+++ b/net/batman-adv/send.c
@@ -45,8 +45,8 @@ int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
45 goto send_skb_err; 45 goto send_skb_err;
46 46
47 if (!(hard_iface->net_dev->flags & IFF_UP)) { 47 if (!(hard_iface->net_dev->flags & IFF_UP)) {
48 pr_warning("Interface %s is not up - can't send packet via " 48 pr_warning("Interface %s is not up - can't send packet via that interface!\n",
49 "that interface!\n", hard_iface->net_dev->name); 49 hard_iface->net_dev->name);
50 goto send_skb_err; 50 goto send_skb_err;
51 } 51 }
52 52
@@ -56,7 +56,7 @@ int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
56 56
57 skb_reset_mac_header(skb); 57 skb_reset_mac_header(skb);
58 58
59 ethhdr = (struct ethhdr *) skb_mac_header(skb); 59 ethhdr = (struct ethhdr *)skb_mac_header(skb);
60 memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN); 60 memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN);
61 memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN); 61 memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN);
62 ethhdr->h_proto = __constant_htons(ETH_P_BATMAN); 62 ethhdr->h_proto = __constant_htons(ETH_P_BATMAN);
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 8fb16d209fd9..a5590f4193f1 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -252,8 +252,8 @@ static void softif_neigh_vid_select(struct bat_priv *bat_priv,
252 vid, curr_neigh->addr); 252 vid, curr_neigh->addr);
253 else if ((curr_neigh) && (new_neigh)) 253 else if ((curr_neigh) && (new_neigh))
254 bat_dbg(DBG_ROUTES, bat_priv, 254 bat_dbg(DBG_ROUTES, bat_priv,
255 "Changing mesh exit point on vid: %d from %pM " 255 "Changing mesh exit point on vid: %d from %pM to %pM.\n",
256 "to %pM.\n", vid, curr_neigh->addr, new_neigh->addr); 256 vid, curr_neigh->addr, new_neigh->addr);
257 else if ((!curr_neigh) && (new_neigh)) 257 else if ((!curr_neigh) && (new_neigh))
258 bat_dbg(DBG_ROUTES, bat_priv, 258 bat_dbg(DBG_ROUTES, bat_priv,
259 "Setting mesh exit point on vid: %d to %pM.\n", 259 "Setting mesh exit point on vid: %d to %pM.\n",
@@ -327,15 +327,15 @@ int softif_neigh_seq_print_text(struct seq_file *seq, void *offset)
327 327
328 primary_if = primary_if_get_selected(bat_priv); 328 primary_if = primary_if_get_selected(bat_priv);
329 if (!primary_if) { 329 if (!primary_if) {
330 ret = seq_printf(seq, "BATMAN mesh %s disabled - " 330 ret = seq_printf(seq,
331 "please specify interfaces to enable it\n", 331 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
332 net_dev->name); 332 net_dev->name);
333 goto out; 333 goto out;
334 } 334 }
335 335
336 if (primary_if->if_status != IF_ACTIVE) { 336 if (primary_if->if_status != IF_ACTIVE) {
337 ret = seq_printf(seq, "BATMAN mesh %s " 337 ret = seq_printf(seq,
338 "disabled - primary interface not active\n", 338 "BATMAN mesh %s disabled - primary interface not active\n",
339 net_dev->name); 339 net_dev->name);
340 goto out; 340 goto out;
341 } 341 }
@@ -403,8 +403,7 @@ void softif_neigh_purge(struct bat_priv *bat_priv)
403 403
404 if (curr_softif_neigh == softif_neigh) { 404 if (curr_softif_neigh == softif_neigh) {
405 bat_dbg(DBG_ROUTES, bat_priv, 405 bat_dbg(DBG_ROUTES, bat_priv,
406 "Current mesh exit point on vid: %d " 406 "Current mesh exit point on vid: %d '%pM' vanished.\n",
407 "'%pM' vanished.\n",
408 softif_neigh_vid->vid, 407 softif_neigh_vid->vid,
409 softif_neigh->addr); 408 softif_neigh->addr);
410 do_deselect = 1; 409 do_deselect = 1;
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c9507057c98e..1f8692127840 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -309,21 +309,21 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset)
309 309
310 primary_if = primary_if_get_selected(bat_priv); 310 primary_if = primary_if_get_selected(bat_priv);
311 if (!primary_if) { 311 if (!primary_if) {
312 ret = seq_printf(seq, "BATMAN mesh %s disabled - " 312 ret = seq_printf(seq,
313 "please specify interfaces to enable it\n", 313 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
314 net_dev->name); 314 net_dev->name);
315 goto out; 315 goto out;
316 } 316 }
317 317
318 if (primary_if->if_status != IF_ACTIVE) { 318 if (primary_if->if_status != IF_ACTIVE) {
319 ret = seq_printf(seq, "BATMAN mesh %s disabled - " 319 ret = seq_printf(seq,
320 "primary interface not active\n", 320 "BATMAN mesh %s disabled - primary interface not active\n",
321 net_dev->name); 321 net_dev->name);
322 goto out; 322 goto out;
323 } 323 }
324 324
325 seq_printf(seq, "Locally retrieved addresses (from %s) " 325 seq_printf(seq,
326 "announced via TT (TTVN: %u):\n", 326 "Locally retrieved addresses (from %s) announced via TT (TTVN: %u):\n",
327 net_dev->name, (uint8_t)atomic_read(&bat_priv->ttvn)); 327 net_dev->name, (uint8_t)atomic_read(&bat_priv->ttvn));
328 328
329 for (i = 0; i < hash->size; i++) { 329 for (i = 0; i < hash->size; i++) {
@@ -365,8 +365,9 @@ static void tt_local_set_pending(struct bat_priv *bat_priv,
365 * response issued before the net ttvn increment (consistency check) */ 365 * response issued before the net ttvn increment (consistency check) */
366 tt_local_entry->common.flags |= TT_CLIENT_PENDING; 366 tt_local_entry->common.flags |= TT_CLIENT_PENDING;
367 367
368 bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: " 368 bat_dbg(DBG_TT, bat_priv,
369 "%s\n", tt_local_entry->common.addr, message); 369 "Local tt entry (%pM) pending to be removed: %s\n",
370 tt_local_entry->common.addr, message);
370} 371}
371 372
372void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr, 373void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr,
@@ -574,15 +575,15 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
574 575
575 primary_if = primary_if_get_selected(bat_priv); 576 primary_if = primary_if_get_selected(bat_priv);
576 if (!primary_if) { 577 if (!primary_if) {
577 ret = seq_printf(seq, "BATMAN mesh %s disabled - please " 578 ret = seq_printf(seq,
578 "specify interfaces to enable it\n", 579 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
579 net_dev->name); 580 net_dev->name);
580 goto out; 581 goto out;
581 } 582 }
582 583
583 if (primary_if->if_status != IF_ACTIVE) { 584 if (primary_if->if_status != IF_ACTIVE) {
584 ret = seq_printf(seq, "BATMAN mesh %s disabled - " 585 ret = seq_printf(seq,
585 "primary interface not active\n", 586 "BATMAN mesh %s disabled - primary interface not active\n",
586 net_dev->name); 587 net_dev->name);
587 goto out; 588 goto out;
588 } 589 }
@@ -602,18 +603,18 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
602 tt_global_entry = container_of(tt_common_entry, 603 tt_global_entry = container_of(tt_common_entry,
603 struct tt_global_entry, 604 struct tt_global_entry,
604 common); 605 common);
605 seq_printf(seq, " * %pM (%3u) via %pM (%3u) " 606 seq_printf(seq,
606 "[%c%c]\n", 607 " * %pM (%3u) via %pM (%3u) [%c%c]\n",
607 tt_global_entry->common.addr, 608 tt_global_entry->common.addr,
608 tt_global_entry->ttvn, 609 tt_global_entry->ttvn,
609 tt_global_entry->orig_node->orig, 610 tt_global_entry->orig_node->orig,
610 (uint8_t) atomic_read( 611 (uint8_t) atomic_read(
611 &tt_global_entry->orig_node-> 612 &tt_global_entry->orig_node->
612 last_ttvn), 613 last_ttvn),
613 (tt_global_entry->common.flags & 614 (tt_global_entry->common.flags &
614 TT_CLIENT_ROAM ? 'R' : '.'), 615 TT_CLIENT_ROAM ? 'R' : '.'),
615 (tt_global_entry->common.flags & 616 (tt_global_entry->common.flags &
616 TT_CLIENT_WIFI ? 'W' : '.')); 617 TT_CLIENT_WIFI ? 'W' : '.'));
617 } 618 }
618 rcu_read_unlock(); 619 rcu_read_unlock();
619 } 620 }
@@ -710,8 +711,7 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
710 common); 711 common);
711 if (tt_global_entry->orig_node == orig_node) { 712 if (tt_global_entry->orig_node == orig_node) {
712 bat_dbg(DBG_TT, bat_priv, 713 bat_dbg(DBG_TT, bat_priv,
713 "Deleting global tt entry %pM " 714 "Deleting global tt entry %pM (via %pM): %s\n",
714 "(via %pM): %s\n",
715 tt_global_entry->common.addr, 715 tt_global_entry->common.addr,
716 tt_global_entry->orig_node->orig, 716 tt_global_entry->orig_node->orig,
717 message); 717 message);
@@ -751,8 +751,8 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv)
751 TT_CLIENT_ROAM_TIMEOUT)) 751 TT_CLIENT_ROAM_TIMEOUT))
752 continue; 752 continue;
753 753
754 bat_dbg(DBG_TT, bat_priv, "Deleting global " 754 bat_dbg(DBG_TT, bat_priv,
755 "tt entry (%pM): Roaming timeout\n", 755 "Deleting global tt entry (%pM): Roaming timeout\n",
756 tt_global_entry->common.addr); 756 tt_global_entry->common.addr);
757 atomic_dec(&tt_global_entry->orig_node->tt_size); 757 atomic_dec(&tt_global_entry->orig_node->tt_size);
758 hlist_del_rcu(node); 758 hlist_del_rcu(node);
@@ -1134,8 +1134,9 @@ static int send_tt_request(struct bat_priv *bat_priv,
1134 if (!neigh_node) 1134 if (!neigh_node)
1135 goto out; 1135 goto out;
1136 1136
1137 bat_dbg(DBG_TT, bat_priv, "Sending TT_REQUEST to %pM via %pM " 1137 bat_dbg(DBG_TT, bat_priv,
1138 "[%c]\n", dst_orig_node->orig, neigh_node->addr, 1138 "Sending TT_REQUEST to %pM via %pM [%c]\n",
1139 dst_orig_node->orig, neigh_node->addr,
1139 (full_table ? 'F' : '.')); 1140 (full_table ? 'F' : '.'));
1140 1141
1141 send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); 1142 send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr);
@@ -1172,9 +1173,8 @@ static bool send_other_tt_response(struct bat_priv *bat_priv,
1172 struct tt_query_packet *tt_response; 1173 struct tt_query_packet *tt_response;
1173 1174
1174 bat_dbg(DBG_TT, bat_priv, 1175 bat_dbg(DBG_TT, bat_priv,
1175 "Received TT_REQUEST from %pM for " 1176 "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n",
1176 "ttvn: %u (%pM) [%c]\n", tt_request->src, 1177 tt_request->src, tt_request->ttvn, tt_request->dst,
1177 tt_request->ttvn, tt_request->dst,
1178 (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); 1178 (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
1179 1179
1180 /* Let's get the orig node of the REAL destination */ 1180 /* Let's get the orig node of the REAL destination */
@@ -1299,9 +1299,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv,
1299 struct tt_query_packet *tt_response; 1299 struct tt_query_packet *tt_response;
1300 1300
1301 bat_dbg(DBG_TT, bat_priv, 1301 bat_dbg(DBG_TT, bat_priv,
1302 "Received TT_REQUEST from %pM for " 1302 "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n",
1303 "ttvn: %u (me) [%c]\n", tt_request->src, 1303 tt_request->src, tt_request->ttvn,
1304 tt_request->ttvn,
1305 (tt_request->flags & TT_FULL_TABLE ? 'F' : '.')); 1304 (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
1306 1305
1307 1306
@@ -1504,10 +1503,9 @@ void handle_tt_response(struct bat_priv *bat_priv,
1504 struct tt_req_node *node, *safe; 1503 struct tt_req_node *node, *safe;
1505 struct orig_node *orig_node = NULL; 1504 struct orig_node *orig_node = NULL;
1506 1505
1507 bat_dbg(DBG_TT, bat_priv, "Received TT_RESPONSE from %pM for " 1506 bat_dbg(DBG_TT, bat_priv,
1508 "ttvn %d t_size: %d [%c]\n", 1507 "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n",
1509 tt_response->src, tt_response->ttvn, 1508 tt_response->src, tt_response->ttvn, tt_response->tt_data,
1510 tt_response->tt_data,
1511 (tt_response->flags & TT_FULL_TABLE ? 'F' : '.')); 1509 (tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
1512 1510
1513 orig_node = orig_hash_find(bat_priv, tt_response->src); 1511 orig_node = orig_hash_find(bat_priv, tt_response->src);
@@ -1771,8 +1769,9 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv)
1771 if (!(tt_common_entry->flags & TT_CLIENT_PENDING)) 1769 if (!(tt_common_entry->flags & TT_CLIENT_PENDING))
1772 continue; 1770 continue;
1773 1771
1774 bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry " 1772 bat_dbg(DBG_TT, bat_priv,
1775 "(%pM): pending\n", tt_common_entry->addr); 1773 "Deleting local tt entry (%pM): pending\n",
1774 tt_common_entry->addr);
1776 1775
1777 atomic_dec(&bat_priv->num_local_tt); 1776 atomic_dec(&bat_priv->num_local_tt);
1778 hlist_del_rcu(node); 1777 hlist_del_rcu(node);
@@ -1877,12 +1876,10 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node,
1877 if (!orig_node->tt_initialised || ttvn != orig_ttvn || 1876 if (!orig_node->tt_initialised || ttvn != orig_ttvn ||
1878 orig_node->tt_crc != tt_crc) { 1877 orig_node->tt_crc != tt_crc) {
1879request_table: 1878request_table:
1880 bat_dbg(DBG_TT, bat_priv, "TT inconsistency for %pM. " 1879 bat_dbg(DBG_TT, bat_priv,
1881 "Need to retrieve the correct information " 1880 "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n",
1882 "(ttvn: %u last_ttvn: %u crc: %u last_crc: " 1881 orig_node->orig, ttvn, orig_ttvn, tt_crc,
1883 "%u num_changes: %u)\n", orig_node->orig, ttvn, 1882 orig_node->tt_crc, tt_num_changes);
1884 orig_ttvn, tt_crc, orig_node->tt_crc,
1885 tt_num_changes);
1886 send_tt_request(bat_priv, orig_node, ttvn, tt_crc, 1883 send_tt_request(bat_priv, orig_node, ttvn, tt_crc,
1887 full_table); 1884 full_table);
1888 return; 1885 return;
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index 0897dfa72c59..676f6a626b2c 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -66,7 +66,7 @@ static struct sk_buff *frag_merge_packet(struct list_head *head,
66 kfree_skb(tmp_skb); 66 kfree_skb(tmp_skb);
67 67
68 memmove(skb->data + uni_diff, skb->data, hdr_len); 68 memmove(skb->data + uni_diff, skb->data, hdr_len);
69 unicast_packet = (struct unicast_packet *) skb_pull(skb, uni_diff); 69 unicast_packet = (struct unicast_packet *)skb_pull(skb, uni_diff);
70 unicast_packet->header.packet_type = BAT_UNICAST; 70 unicast_packet->header.packet_type = BAT_UNICAST;
71 71
72 return skb; 72 return skb;
@@ -238,7 +238,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
238 goto dropped; 238 goto dropped;
239 skb_reserve(frag_skb, ucf_hdr_len); 239 skb_reserve(frag_skb, ucf_hdr_len);
240 240
241 unicast_packet = (struct unicast_packet *) skb->data; 241 unicast_packet = (struct unicast_packet *)skb->data;
242 memcpy(&tmp_uc, unicast_packet, uc_hdr_len); 242 memcpy(&tmp_uc, unicast_packet, uc_hdr_len);
243 skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len); 243 skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len);
244 244