diff options
author | Ying Xue <ying.xue@windriver.com> | 2015-01-09 02:27:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-12 16:24:33 -0500 |
commit | e05b31f4bf8994d49322e9afb004ad479a129db0 (patch) | |
tree | 7d413a68ee6fdc5ca81b2eec93323433e61753a8 /net/tipc/core.h | |
parent | 1da465683a93142488a54a9038155f23d6349441 (diff) |
tipc: make tipc socket support net namespace
Now tipc socket table is statically allocated as a global variable.
Through it, we can look up one socket instance with port ID, insert
a new socket instance to the table, and delete a socket from the
table. But when tipc supports net namespace, each namespace must own
its specific socket table. So the global variable of socket table
must be redefined in tipc_net structure. As a concequence, a new
socket table will be allocated when a new namespace is created, and
a socket table will be deallocated when namespace is destroyed.
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>
Diffstat (limited to 'net/tipc/core.h')
-rw-r--r-- | net/tipc/core.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h index 3f6f9e07da99..1a7f81643668 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
@@ -58,6 +58,7 @@ | |||
58 | #include <linux/rtnetlink.h> | 58 | #include <linux/rtnetlink.h> |
59 | #include <linux/etherdevice.h> | 59 | #include <linux/etherdevice.h> |
60 | #include <net/netns/generic.h> | 60 | #include <net/netns/generic.h> |
61 | #include <linux/rhashtable.h> | ||
61 | 62 | ||
62 | #include "node.h" | 63 | #include "node.h" |
63 | #include "bearer.h" | 64 | #include "bearer.h" |
@@ -101,6 +102,9 @@ struct tipc_net { | |||
101 | struct tipc_bcbearer *bcbearer; | 102 | struct tipc_bcbearer *bcbearer; |
102 | struct tipc_bclink *bclink; | 103 | struct tipc_bclink *bclink; |
103 | struct tipc_link *bcl; | 104 | struct tipc_link *bcl; |
105 | |||
106 | /* Socket hash table */ | ||
107 | struct rhashtable sk_rht; | ||
104 | }; | 108 | }; |
105 | 109 | ||
106 | #ifdef CONFIG_SYSCTL | 110 | #ifdef CONFIG_SYSCTL |