aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/bearer.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/bearer.c')
-rw-r--r--net/tipc/bearer.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 609c30c80816..3f9707a16d06 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -387,7 +387,7 @@ restart:
387 387
388 b_ptr = &tipc_bearers[bearer_id]; 388 b_ptr = &tipc_bearers[bearer_id];
389 strcpy(b_ptr->name, name); 389 strcpy(b_ptr->name, name);
390 res = m_ptr->enable_bearer(b_ptr); 390 res = m_ptr->enable_media(b_ptr);
391 if (res) { 391 if (res) {
392 pr_warn("Bearer <%s> rejected, enable failure (%d)\n", 392 pr_warn("Bearer <%s> rejected, enable failure (%d)\n",
393 name, -res); 393 name, -res);
@@ -420,23 +420,15 @@ exit:
420} 420}
421 421
422/** 422/**
423 * tipc_block_bearer - Block the bearer with the given name, and reset all its links 423 * tipc_block_bearer - Block the bearer, and reset all its links
424 */ 424 */
425int tipc_block_bearer(const char *name) 425int tipc_block_bearer(struct tipc_bearer *b_ptr)
426{ 426{
427 struct tipc_bearer *b_ptr = NULL;
428 struct tipc_link *l_ptr; 427 struct tipc_link *l_ptr;
429 struct tipc_link *temp_l_ptr; 428 struct tipc_link *temp_l_ptr;
430 429
431 read_lock_bh(&tipc_net_lock); 430 read_lock_bh(&tipc_net_lock);
432 b_ptr = tipc_bearer_find(name); 431 pr_info("Blocking bearer <%s>\n", b_ptr->name);
433 if (!b_ptr) {
434 pr_warn("Attempt to block unknown bearer <%s>\n", name);
435 read_unlock_bh(&tipc_net_lock);
436 return -EINVAL;
437 }
438
439 pr_info("Blocking bearer <%s>\n", name);
440 spin_lock_bh(&b_ptr->lock); 432 spin_lock_bh(&b_ptr->lock);
441 b_ptr->blocked = 1; 433 b_ptr->blocked = 1;
442 list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { 434 list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
@@ -465,7 +457,7 @@ static void bearer_disable(struct tipc_bearer *b_ptr)
465 pr_info("Disabling bearer <%s>\n", b_ptr->name); 457 pr_info("Disabling bearer <%s>\n", b_ptr->name);
466 spin_lock_bh(&b_ptr->lock); 458 spin_lock_bh(&b_ptr->lock);
467 b_ptr->blocked = 1; 459 b_ptr->blocked = 1;
468 b_ptr->media->disable_bearer(b_ptr); 460 b_ptr->media->disable_media(b_ptr);
469 list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { 461 list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
470 tipc_link_delete(l_ptr); 462 tipc_link_delete(l_ptr);
471 } 463 }