The following commit has been merged in the merge/master branch:
commit 9090211776319028d1735e8a86727ac48ecf588e
Merge: b906204f0dfb5ff298d9499d8da3b26113eed90c a1eecddcb39f1a25506683d98ce349087b258ab4
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Wed Mar 27 09:54:39 2013 +0100
Merge remote-tracking branch 'pkg/next' into merge/master
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Conflicts:
net/batman-adv/compat.h
diff --combined net/batman-adv/gateway_client.c
index 34f99a4,f105219..f105219
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@@ -500,7 -500,7 +500,7 @@@ int batadv_gw_client_seq_print_text(str
rcu_read_unlock();
if (gw_count == 0)
- seq_printf(seq, "No gateways in range ...\n");
+ seq_puts(seq, "No gateways in range ...\n");
out:
if (primary_if)
diff --combined net/batman-adv/hard-interface.c
index fd99e42,522243a..522243a
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@@ -307,6 -307,30 +307,30 @@@ batadv_hardif_deactivate_interface(stru
batadv_update_min_mtu(hard_iface->soft_iface);
}
+ /**
+ * batadv_master_del_slave - remove hard_iface from the current master interface
+ * @slave: the interface enslaved in another master
+ * @master: the master from which slave has to be removed
+ *
+ * Invoke ndo_del_slave on master passing slave as argument. In this way slave
+ * is free'd and master can correctly change its internal state.
+ * Return 0 on success, a negative value representing the error otherwise
+ */
+ static int batadv_master_del_slave(struct batadv_hard_iface *slave,
+ struct net_device *master)
+ {
+ int ret;
+
+ if (!master)
+ return 0;
+
+ ret = -EBUSY;
+ if (master->netdev_ops->ndo_del_slave)
+ ret = master->netdev_ops->ndo_del_slave(master, slave->net_dev);
+
+ return ret;
+ }
+
int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
const char *iface_name)
{
@@@ -346,8 -370,9 +370,9 @@@
* in that case unlink it first
*/
master = netdev_master_upper_dev_get(hard_iface->net_dev);
- if (master)
- netdev_upper_dev_unlink(hard_iface->net_dev, master);
+ ret = batadv_master_del_slave(hard_iface, master);
+ if (ret)
+ goto err_dev;
hard_iface->soft_iface = soft_iface;
bat_priv = netdev_priv(hard_iface->soft_iface);
@@@ -410,6 -435,7 +435,7 @@@ out
err_upper:
netdev_upper_dev_unlink(hard_iface->net_dev, soft_iface);
err_dev:
+ hard_iface->soft_iface = NULL;
dev_put(soft_iface);
err:
batadv_hardif_free_ref(hard_iface);
diff --combined net/batman-adv/main.c
index 62b1f89,6277735..6277735
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@@ -419,7 -419,7 +419,7 @@@ int batadv_algo_seq_print_text(struct s
{
struct batadv_algo_ops *bat_algo_ops;
- seq_printf(seq, "Available routing algorithms:\n");
+ seq_puts(seq, "Available routing algorithms:\n");
hlist_for_each_entry(bat_algo_ops, &batadv_algo_list, list) {
seq_printf(seq, "%s\n", bat_algo_ops->name);
diff --combined net/batman-adv/network-coding.c
index 086c107,6b9a544..6b9a544
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@@ -1760,23 -1760,23 +1760,23 @@@ int batadv_nc_nodes_seq_print_text(stru
hlist_for_each_entry_rcu(orig_node, head, hash_entry) {
seq_printf(seq, "Node: %pM\n", orig_node->orig);
- seq_printf(seq, " Ingoing: ");
+ seq_puts(seq, " Ingoing: ");
/* For each in_nc_node to this orig_node */
list_for_each_entry_rcu(nc_node,
&orig_node->in_coding_list,
list)
seq_printf(seq, "%pM ",
nc_node->addr);
- seq_printf(seq, "\n");
+ seq_puts(seq, "\n");
- seq_printf(seq, " Outgoing: ");
+ seq_puts(seq, " Outgoing: ");
/* For out_nc_node to this orig_node */
list_for_each_entry_rcu(nc_node,
&orig_node->out_coding_list,
list)
seq_printf(seq, "%pM ",
nc_node->addr);
- seq_printf(seq, "\n\n");
+ seq_puts(seq, "\n\n");
}
rcu_read_unlock();
}
diff --combined net/batman-adv/originator.c
index 585e684,2f34525..2f34525
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@@ -465,7 -465,7 +465,7 @@@ int batadv_orig_seq_print_text(struct s
neigh_node_tmp->tq_avg);
}
- seq_printf(seq, "\n");
+ seq_puts(seq, "\n");
batman_count++;
next:
@@@ -475,7 -475,7 +475,7 @@@
}
if (batman_count == 0)
- seq_printf(seq, "No batman nodes in range ...\n");
+ seq_puts(seq, "No batman nodes in range ...\n");
out:
if (primary_if)
diff --combined net/batman-adv/vis.c
index c053244,962ccf3..962ccf3
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@@ -149,7 -149,7 +149,7 @@@ static void batadv_vis_data_read_prim_s
hlist_for_each_entry(entry, if_list, list) {
if (entry->primary)
- seq_printf(seq, "PRIMARY, ");
+ seq_puts(seq, "PRIMARY, ");
else
seq_printf(seq, "SEC %pM, ", entry->addr);
}
@@@ -207,7 -207,7 +207,7 @@@ static void batadv_vis_data_read_entrie
if (batadv_compare_eth(entry->addr, packet->vis_orig))
batadv_vis_data_read_prim_sec(seq, list);
- seq_printf(seq, "\n");
+ seq_puts(seq, "\n");
}
}
--
linux integration