tipc: make bearer list support net namespace
Bearer list defined as a global variable is used to store bearer
instances. When tipc supports net namespace, bearers created in
one namespace must be isolated with others allocated in other
namespaces, which requires us that the bearer list(bearer_list)
must be moved to tipc_net structure. As a result, a net namespace
pointer has to be passed to functions which access the bearer list.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Tested-by: Tero Aho <Tero.Aho@coriant.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/tipc/net.c b/net/tipc/net.c
index de18aac..38633e5 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -117,7 +117,7 @@
tipc_own_addr = addr;
tipc_named_reinit();
tipc_sk_reinit();
- res = tipc_bclink_init();
+ res = tipc_bclink_init(net);
if (res)
return res;
@@ -140,7 +140,7 @@
tipc_own_addr);
rtnl_lock();
tipc_bearer_stop(net);
- tipc_bclink_stop();
+ tipc_bclink_stop(net);
tipc_node_stop(net);
rtnl_unlock();