aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r--net/tipc/core.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 60b85ec6d10..e071579e085 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -115,10 +115,11 @@ int tipc_core_start_net(unsigned long addr)
115{ 115{
116 int res; 116 int res;
117 117
118 if ((res = tipc_net_start(addr)) || 118 res = tipc_net_start(addr);
119 (res = tipc_eth_media_start())) { 119 if (!res)
120 res = tipc_eth_media_start();
121 if (res)
120 tipc_core_stop_net(); 122 tipc_core_stop_net();
121 }
122 return res; 123 return res;
123} 124}
124 125
@@ -157,15 +158,22 @@ static int tipc_core_start(void)
157 get_random_bytes(&tipc_random, sizeof(tipc_random)); 158 get_random_bytes(&tipc_random, sizeof(tipc_random));
158 tipc_mode = TIPC_NODE_MODE; 159 tipc_mode = TIPC_NODE_MODE;
159 160
160 if ((res = tipc_handler_start()) || 161 res = tipc_handler_start();
161 (res = tipc_ref_table_init(tipc_max_ports, tipc_random)) || 162 if (!res)
162 (res = tipc_nametbl_init()) || 163 res = tipc_ref_table_init(tipc_max_ports, tipc_random);
163 (res = tipc_k_signal((Handler)tipc_subscr_start, 0)) || 164 if (!res)
164 (res = tipc_k_signal((Handler)tipc_cfg_init, 0)) || 165 res = tipc_nametbl_init();
165 (res = tipc_netlink_start()) || 166 if (!res)
166 (res = tipc_socket_init())) { 167 res = tipc_k_signal((Handler)tipc_subscr_start, 0);
168 if (!res)
169 res = tipc_k_signal((Handler)tipc_cfg_init, 0);
170 if (!res)
171 res = tipc_netlink_start();
172 if (!res)
173 res = tipc_socket_init();
174 if (res)
167 tipc_core_stop(); 175 tipc_core_stop();
168 } 176
169 return res; 177 return res;
170} 178}
171 179
@@ -188,7 +196,8 @@ static int __init tipc_init(void)
188 tipc_max_nodes = CONFIG_TIPC_NODES; 196 tipc_max_nodes = CONFIG_TIPC_NODES;
189 tipc_net_id = 4711; 197 tipc_net_id = 4711;
190 198
191 if ((res = tipc_core_start())) 199 res = tipc_core_start();
200 if (res)
192 err("Unable to start in single node mode\n"); 201 err("Unable to start in single node mode\n");
193 else 202 else
194 info("Started in single node mode\n"); 203 info("Started in single node mode\n");