aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/net.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-05-04 20:56:16 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-05 17:26:45 -0400
commiteb8b00f5f248c50603bca383792ac3a618297be0 (patch)
tree429c3bff534952209c848f011cb675530a115b5d /net/tipc/net.c
parentd69afc90b8d47e471d2870f090f662e569b08407 (diff)
tipc: convert allocations of global variables associated with bclink
Convert allocations of global variables associated with bclink from static way to dynamical way for the convenience of bclink instance initialisation. Meanwhile, this also helps TIPC support name space in the future easily. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 75bb39025d53..f8fc95d58c0d 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -164,20 +164,25 @@ void tipc_net_route_msg(struct sk_buff *buf)
164 tipc_link_xmit(buf, dnode, msg_link_selector(msg)); 164 tipc_link_xmit(buf, dnode, msg_link_selector(msg));
165} 165}
166 166
167void tipc_net_start(u32 addr) 167int tipc_net_start(u32 addr)
168{ 168{
169 char addr_string[16]; 169 char addr_string[16];
170 int res;
170 171
171 tipc_own_addr = addr; 172 tipc_own_addr = addr;
172 tipc_named_reinit(); 173 tipc_named_reinit();
173 tipc_port_reinit(); 174 tipc_port_reinit();
174 tipc_bclink_init(); 175 res = tipc_bclink_init();
176 if (res)
177 return res;
178
175 tipc_nametbl_publish(TIPC_CFG_SRV, tipc_own_addr, tipc_own_addr, 179 tipc_nametbl_publish(TIPC_CFG_SRV, tipc_own_addr, tipc_own_addr,
176 TIPC_ZONE_SCOPE, 0, tipc_own_addr); 180 TIPC_ZONE_SCOPE, 0, tipc_own_addr);
177 181
178 pr_info("Started in network mode\n"); 182 pr_info("Started in network mode\n");
179 pr_info("Own node address %s, network identity %u\n", 183 pr_info("Own node address %s, network identity %u\n",
180 tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id); 184 tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id);
185 return 0;
181} 186}
182 187
183void tipc_net_stop(void) 188void tipc_net_stop(void)