diff options
author | Ying Xue <ying.xue@windriver.com> | 2015-01-09 02:27:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-12 16:24:33 -0500 |
commit | 347475395434abb2b61bf59c2952470f37072567 (patch) | |
tree | 71a5f63547edecee31f557d0bacbf993b953a099 /net/tipc/discover.c | |
parent | 4ac1c8d0ee9faf3a4be185cc4db1381fa0d81280 (diff) |
tipc: make tipc node address support net namespace
If net namespace is supported in tipc, each namespace will be treated
as a separate tipc node. Therefore, every namespace must own its
private tipc node address. This means the "tipc_own_addr" global
variable of node address must be moved to tipc_net structure to
satisfy the requirement. It's turned out that users also can assign
node address for every namespace.
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/discover.c')
-rw-r--r-- | net/tipc/discover.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index f93dd3dd621b..786411dea61c 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -86,7 +86,7 @@ static void tipc_disc_init_msg(struct net *net, struct sk_buff *buf, u32 type, | |||
86 | u32 dest_domain = b_ptr->domain; | 86 | u32 dest_domain = b_ptr->domain; |
87 | 87 | ||
88 | msg = buf_msg(buf); | 88 | msg = buf_msg(buf); |
89 | tipc_msg_init(msg, LINK_CONFIG, type, INT_H_SIZE, dest_domain); | 89 | tipc_msg_init(net, msg, LINK_CONFIG, type, INT_H_SIZE, dest_domain); |
90 | msg_set_non_seq(msg, 1); | 90 | msg_set_non_seq(msg, 1); |
91 | msg_set_node_sig(msg, tipc_random); | 91 | msg_set_node_sig(msg, tipc_random); |
92 | msg_set_dest_domain(msg, dest_domain); | 92 | msg_set_dest_domain(msg, dest_domain); |
@@ -153,12 +153,12 @@ void tipc_disc_rcv(struct net *net, struct sk_buff *buf, | |||
153 | if (!tipc_addr_node_valid(onode)) | 153 | if (!tipc_addr_node_valid(onode)) |
154 | return; | 154 | return; |
155 | 155 | ||
156 | if (in_own_node(onode)) { | 156 | if (in_own_node(net, onode)) { |
157 | if (memcmp(&maddr, &bearer->addr, sizeof(maddr))) | 157 | if (memcmp(&maddr, &bearer->addr, sizeof(maddr))) |
158 | disc_dupl_alert(bearer, tipc_own_addr, &maddr); | 158 | disc_dupl_alert(bearer, tn->own_addr, &maddr); |
159 | return; | 159 | return; |
160 | } | 160 | } |
161 | if (!tipc_in_scope(ddom, tipc_own_addr)) | 161 | if (!tipc_in_scope(ddom, tn->own_addr)) |
162 | return; | 162 | return; |
163 | if (!tipc_in_scope(bearer->domain, onode)) | 163 | if (!tipc_in_scope(bearer->domain, onode)) |
164 | return; | 164 | return; |