diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2006-06-26 08:51:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-26 08:51:37 +0200 |
commit | f131072c3da84e70a0f65d71b3a3f6611c6a22bc (patch) | |
tree | 6b00e151ee25a9d20fc56c4aa5f947561a65047d /net/tipc/node_subscr.c | |
parent | [TIPC]: Disallow config operations that aren't supported in certain modes. (diff) | |
download | linux-f131072c3da84e70a0f65d71b3a3f6611c6a22bc.tar.xz linux-f131072c3da84e70a0f65d71b3a3f6611c6a22bc.zip |
[TIPC]: First phase of assert() cleanup
This also contains enhancements to simplify comparisons in name table
publication removal algorithm and to simplify name table sanity checking
when shutting down TIPC.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Per Liden <per.liden@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node_subscr.c')
-rw-r--r-- | net/tipc/node_subscr.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c index cff4068cc755..cc3fff3dec4f 100644 --- a/net/tipc/node_subscr.c +++ b/net/tipc/node_subscr.c @@ -47,18 +47,19 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, void *usr_handle, net_ev_handler handle_down) { - node_sub->node = NULL; - if (addr == tipc_own_addr) + if (addr == tipc_own_addr) { + node_sub->node = NULL; return; - if (!tipc_addr_node_valid(addr)) { - warn("node_subscr with illegal %x\n", addr); + } + + node_sub->node = tipc_node_find(addr); + if (!node_sub->node) { + warn("Node subscription rejected, unknown node 0x%x\n", addr); return; } - node_sub->handle_node_down = handle_down; node_sub->usr_handle = usr_handle; - node_sub->node = tipc_node_find(addr); - assert(node_sub->node); + tipc_node_lock(node_sub->node); list_add_tail(&node_sub->nodesub_list, &node_sub->node->nsub); tipc_node_unlock(node_sub->node); |