diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index ca09b33fb87f..2d106ef4fa4c 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -238,33 +238,11 @@ int tipc_node_is_up(struct tipc_node *n_ptr) | |||
238 | return tipc_node_active_links(n_ptr); | 238 | return tipc_node_active_links(n_ptr); |
239 | } | 239 | } |
240 | 240 | ||
241 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr) | 241 | void tipc_node_attach_link(struct tipc_node *n_ptr, struct link *l_ptr) |
242 | { | 242 | { |
243 | struct tipc_node *n_ptr = tipc_node_find(l_ptr->addr); | 243 | n_ptr->links[l_ptr->b_ptr->identity] = l_ptr; |
244 | 244 | atomic_inc(&tipc_num_links); | |
245 | if (!n_ptr) | 245 | n_ptr->link_cnt++; |
246 | n_ptr = tipc_node_create(l_ptr->addr); | ||
247 | if (n_ptr) { | ||
248 | u32 bearer_id = l_ptr->b_ptr->identity; | ||
249 | char addr_string[16]; | ||
250 | |||
251 | if (n_ptr->link_cnt >= 2) { | ||
252 | err("Attempt to create third link to %s\n", | ||
253 | tipc_addr_string_fill(addr_string, n_ptr->addr)); | ||
254 | return NULL; | ||
255 | } | ||
256 | |||
257 | if (!n_ptr->links[bearer_id]) { | ||
258 | n_ptr->links[bearer_id] = l_ptr; | ||
259 | atomic_inc(&tipc_num_links); | ||
260 | n_ptr->link_cnt++; | ||
261 | return n_ptr; | ||
262 | } | ||
263 | err("Attempt to establish second link on <%s> to %s\n", | ||
264 | l_ptr->b_ptr->name, | ||
265 | tipc_addr_string_fill(addr_string, l_ptr->addr)); | ||
266 | } | ||
267 | return NULL; | ||
268 | } | 246 | } |
269 | 247 | ||
270 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) | 248 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) |