mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
tipc: name tipc name table support net namespace
TIPC name table is used to store the mapping relationship between TIPC service name and socket port ID. When tipc supports namespace, it allows users to publish service names only owned by a certain namespace. Therefore, every namespace must have its private name table to prevent service names published to one namespace from being contaminated by other service names in another namespace. Therefore, The name table global variable (ie, nametbl) and its lock must be moved to tipc_net structure, and a parameter of namespace must be added for necessary functions so that they can obtain name table variable defined in tipc_net structure. 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>
This commit is contained in:
parent
e05b31f4bf
commit
4ac1c8d0ee
15 changed files with 154 additions and 116 deletions
|
@ -62,12 +62,24 @@ static int __net_init tipc_init_net(struct net *net)
|
|||
spin_lock_init(&tn->node_list_lock);
|
||||
|
||||
err = tipc_sk_rht_init(net);
|
||||
if (err)
|
||||
goto out_sk_rht;
|
||||
|
||||
err = tipc_nametbl_init(net);
|
||||
if (err)
|
||||
goto out_nametbl;
|
||||
return 0;
|
||||
|
||||
out_nametbl:
|
||||
tipc_sk_rht_destroy(net);
|
||||
out_sk_rht:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void __net_exit tipc_exit_net(struct net *net)
|
||||
{
|
||||
tipc_net_stop(net);
|
||||
tipc_nametbl_stop(net);
|
||||
tipc_sk_rht_destroy(net);
|
||||
}
|
||||
|
||||
|
@ -98,10 +110,6 @@ static int __init tipc_init(void)
|
|||
if (err)
|
||||
goto out_pernet;
|
||||
|
||||
err = tipc_nametbl_init();
|
||||
if (err)
|
||||
goto out_nametbl;
|
||||
|
||||
err = tipc_netlink_start();
|
||||
if (err)
|
||||
goto out_netlink;
|
||||
|
@ -133,8 +141,6 @@ out_sysctl:
|
|||
out_socket:
|
||||
tipc_netlink_stop();
|
||||
out_netlink:
|
||||
tipc_nametbl_stop();
|
||||
out_nametbl:
|
||||
unregister_pernet_subsys(&tipc_net_ops);
|
||||
out_pernet:
|
||||
pr_err("Unable to start in single node mode\n");
|
||||
|
@ -147,7 +153,6 @@ static void __exit tipc_exit(void)
|
|||
tipc_bearer_cleanup();
|
||||
tipc_netlink_stop();
|
||||
tipc_subscr_stop();
|
||||
tipc_nametbl_stop();
|
||||
tipc_socket_stop();
|
||||
tipc_unregister_sysctl();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue