From: Greg Kroah-Hartman Date: Thu, 14 Nov 2013 03:14:39 +0000 (+0900) Subject: 3.10-stable patches X-Git-Tag: v3.4.70~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43d4f5360ad896de1d4eb5b822a773c26091a7d1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: batman-adv-set-up-network-coding-packet-handlers-during-module-init.patch --- diff --git a/queue-3.10/batman-adv-set-up-network-coding-packet-handlers-during-module-init.patch b/queue-3.10/batman-adv-set-up-network-coding-packet-handlers-during-module-init.patch new file mode 100644 index 00000000000..0890256fd0f --- /dev/null +++ b/queue-3.10/batman-adv-set-up-network-coding-packet-handlers-during-module-init.patch @@ -0,0 +1,158 @@ +From 6c519bad7b19a2c14a075b400edabaa630330123 Mon Sep 17 00:00:00 2001 +From: Matthias Schiffer +Date: Fri, 27 Sep 2013 18:03:39 +0200 +Subject: batman-adv: set up network coding packet handlers during module init + +From: Matthias Schiffer + +commit 6c519bad7b19a2c14a075b400edabaa630330123 upstream. + +batman-adv saves its table of packet handlers as a global state, so handlers +must be set up only once (and setting them up a second time will fail). + +The recently-added network coding support tries to set up its handler each time +a new softif is registered, which obviously fails when more that one softif is +used (and in consequence, the softif creation fails). + +Fix this by splitting up batadv_nc_init into batadv_nc_init (which is called +only once) and batadv_nc_mesh_init (which is called for each softif); in +addition batadv_nc_free is renamed to batadv_nc_mesh_free to keep naming +consistent. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Marek Lindner +Signed-off-by: Antonio Quartulli +Cc: David Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/batman-adv/main.c | 5 +++-- + net/batman-adv/network-coding.c | 28 ++++++++++++++++++---------- + net/batman-adv/network-coding.h | 14 ++++++++++---- + 3 files changed, 31 insertions(+), 16 deletions(-) + +--- a/net/batman-adv/main.c ++++ b/net/batman-adv/main.c +@@ -61,6 +61,7 @@ static int __init batadv_init(void) + batadv_recv_handler_init(); + + batadv_iv_init(); ++ batadv_nc_init(); + + batadv_event_workqueue = create_singlethread_workqueue("bat_events"); + +@@ -138,7 +139,7 @@ int batadv_mesh_init(struct net_device * + if (ret < 0) + goto err; + +- ret = batadv_nc_init(bat_priv); ++ ret = batadv_nc_mesh_init(bat_priv); + if (ret < 0) + goto err; + +@@ -163,7 +164,7 @@ void batadv_mesh_free(struct net_device + batadv_vis_quit(bat_priv); + + batadv_gw_node_purge(bat_priv); +- batadv_nc_free(bat_priv); ++ batadv_nc_mesh_free(bat_priv); + batadv_dat_free(bat_priv); + batadv_bla_free(bat_priv); + +--- a/net/batman-adv/network-coding.c ++++ b/net/batman-adv/network-coding.c +@@ -35,6 +35,20 @@ static int batadv_nc_recv_coded_packet(s + struct batadv_hard_iface *recv_if); + + /** ++ * batadv_nc_init - one-time initialization for network coding ++ */ ++int __init batadv_nc_init(void) ++{ ++ int ret; ++ ++ /* Register our packet type */ ++ ret = batadv_recv_handler_register(BATADV_CODED, ++ batadv_nc_recv_coded_packet); ++ ++ return ret; ++} ++ ++/** + * batadv_nc_start_timer - initialise the nc periodic worker + * @bat_priv: the bat priv with all the soft interface information + */ +@@ -45,10 +59,10 @@ static void batadv_nc_start_timer(struct + } + + /** +- * batadv_nc_init - initialise coding hash table and start house keeping ++ * batadv_nc_mesh_init - initialise coding hash table and start house keeping + * @bat_priv: the bat priv with all the soft interface information + */ +-int batadv_nc_init(struct batadv_priv *bat_priv) ++int batadv_nc_mesh_init(struct batadv_priv *bat_priv) + { + bat_priv->nc.timestamp_fwd_flush = jiffies; + bat_priv->nc.timestamp_sniffed_purge = jiffies; +@@ -70,11 +84,6 @@ int batadv_nc_init(struct batadv_priv *b + batadv_hash_set_lock_class(bat_priv->nc.coding_hash, + &batadv_nc_decoding_hash_lock_class_key); + +- /* Register our packet type */ +- if (batadv_recv_handler_register(BATADV_CODED, +- batadv_nc_recv_coded_packet) < 0) +- goto err; +- + INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); + batadv_nc_start_timer(bat_priv); + +@@ -1722,12 +1731,11 @@ free_nc_packet: + } + + /** +- * batadv_nc_free - clean up network coding memory ++ * batadv_nc_mesh_free - clean up network coding memory + * @bat_priv: the bat priv with all the soft interface information + */ +-void batadv_nc_free(struct batadv_priv *bat_priv) ++void batadv_nc_mesh_free(struct batadv_priv *bat_priv) + { +- batadv_recv_handler_unregister(BATADV_CODED); + cancel_delayed_work_sync(&bat_priv->nc.work); + + batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL); +--- a/net/batman-adv/network-coding.h ++++ b/net/batman-adv/network-coding.h +@@ -22,8 +22,9 @@ + + #ifdef CONFIG_BATMAN_ADV_NC + +-int batadv_nc_init(struct batadv_priv *bat_priv); +-void batadv_nc_free(struct batadv_priv *bat_priv); ++int batadv_nc_init(void); ++int batadv_nc_mesh_init(struct batadv_priv *bat_priv); ++void batadv_nc_mesh_free(struct batadv_priv *bat_priv); + void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, + struct batadv_orig_node *orig_node, + struct batadv_orig_node *orig_neigh_node, +@@ -47,12 +48,17 @@ int batadv_nc_init_debugfs(struct batadv + + #else /* ifdef CONFIG_BATMAN_ADV_NC */ + +-static inline int batadv_nc_init(struct batadv_priv *bat_priv) ++static inline int batadv_nc_init(void) + { + return 0; + } + +-static inline void batadv_nc_free(struct batadv_priv *bat_priv) ++static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv) ++{ ++ return 0; ++} ++ ++static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv) + { + return; + } diff --git a/queue-3.10/series b/queue-3.10/series index bfa876f629d..32376996f22 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -8,3 +8,4 @@ net-flow_dissector-fail-on-evil-iph-ihl.patch net-mlx4_core-fix-call-to-__mlx4_unregister_mac.patch xen-netback-handle-backend-state-transitions-in-a-more-robust-way.patch xen-netback-transition-to-closed-when-removing-a-vif.patch +batman-adv-set-up-network-coding-packet-handlers-during-module-init.patch