X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Ftipc%2Fnode_subscr.c;h=cff4068cc755295c8fa2708abb8bdeac93d97d82;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=cc3fff3dec4f825cefda388a04b3d97b397be013;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c index cc3fff3de..cff4068cc 100644 --- a/net/tipc/node_subscr.c +++ b/net/tipc/node_subscr.c @@ -47,19 +47,18 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, void *usr_handle, net_ev_handler handle_down) { - if (addr == tipc_own_addr) { - node_sub->node = NULL; + node_sub->node = NULL; + if (addr == tipc_own_addr) return; - } - - node_sub->node = tipc_node_find(addr); - if (!node_sub->node) { - warn("Node subscription rejected, unknown node 0x%x\n", addr); + if (!tipc_addr_node_valid(addr)) { + warn("node_subscr with illegal %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);