diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-10-22 08:51:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-24 09:56:30 -0400 |
commit | 0e05498e9eae16a6d8c86543e77930ec152e655e (patch) | |
tree | d9c7a0ec7ea13f4babaa52b2c71068e8deda1bac /net/tipc/node.c | |
parent | 5fd9fd635104f4816da158cdac6917e99e192eac (diff) |
tipc: make link implementation independent from struct tipc_bearer
In reality, the link implementation is already independent from
struct tipc_bearer, in that it doesn't store any reference to it.
However, we still pass on a pointer to a bearer instance in the
function tipc_link_create(), just to have it extract some
initialization information from it.
I later commits, we need to create instances of tipc_link without
having any associated struct tipc_bearer. To facilitate this, we
want to extract the initialization data already in the creator
function in node.c, before calling tipc_link_create(), and pass
this info on as individual parameters in the call.
This commit introduces this change.
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 2670751d0e2e..d3f7ca202281 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -493,6 +493,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, | |||
493 | bool link_up = false; | 493 | bool link_up = false; |
494 | bool accept_addr = false; | 494 | bool accept_addr = false; |
495 | bool reset = true; | 495 | bool reset = true; |
496 | char *if_name; | ||
496 | 497 | ||
497 | *dupl_addr = false; | 498 | *dupl_addr = false; |
498 | *respond = false; | 499 | *respond = false; |
@@ -579,7 +580,10 @@ void tipc_node_check_dest(struct net *net, u32 onode, | |||
579 | pr_warn("Cannot establish 3rd link to %x\n", n->addr); | 580 | pr_warn("Cannot establish 3rd link to %x\n", n->addr); |
580 | goto exit; | 581 | goto exit; |
581 | } | 582 | } |
582 | if (!tipc_link_create(n, b, mod(tipc_net(net)->random), | 583 | if_name = strchr(b->name, ':') + 1; |
584 | if (!tipc_link_create(n, if_name, b->identity, b->tolerance, | ||
585 | b->net_plane, b->mtu, b->priority, | ||
586 | b->window, mod(tipc_net(net)->random), | ||
583 | tipc_own_addr(net), onode, &le->maddr, | 587 | tipc_own_addr(net), onode, &le->maddr, |
584 | &le->inputq, &n->bclink.namedq, &l)) { | 588 | &le->inputq, &n->bclink.namedq, &l)) { |
585 | *respond = false; | 589 | *respond = false; |