提交 a5e7ac5c 编写于 作者: E Erik Hugne 提交者: David S. Miller

tipc: fix regression bug where node events are not being generated

Commit 5902385a ("tipc: obsolete
the remote management feature") introduces a regression where node
topology events are not being generated because the publication
that triggers this: {0, <z.c.n>, <z.c.n>} is no longer available.
This will break applications that rely on node events to discover
when nodes join/leave a cluster.

We fix this by advertising the node publication when TIPC enters
networking mode, and withdraws it upon shutdown.
Signed-off-by: NErik Hugne <erik.hugne@ericsson.com>
Reviewed-by: NJon Maloy <jon.maloy@ericsson.com>
Reviewed-by: NYing Xue <ying.xue@windriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d9bd6461
...@@ -182,6 +182,8 @@ void tipc_net_start(u32 addr) ...@@ -182,6 +182,8 @@ void tipc_net_start(u32 addr)
tipc_bclink_init(); tipc_bclink_init();
write_unlock_bh(&tipc_net_lock); write_unlock_bh(&tipc_net_lock);
tipc_nametbl_publish(TIPC_CFG_SRV, tipc_own_addr, tipc_own_addr,
TIPC_ZONE_SCOPE, 0, tipc_own_addr);
pr_info("Started in network mode\n"); pr_info("Started in network mode\n");
pr_info("Own node address %s, network identity %u\n", pr_info("Own node address %s, network identity %u\n",
tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id); tipc_addr_string_fill(addr_string, tipc_own_addr), tipc_net_id);
...@@ -192,6 +194,7 @@ void tipc_net_stop(void) ...@@ -192,6 +194,7 @@ void tipc_net_stop(void)
if (!tipc_own_addr) if (!tipc_own_addr)
return; return;
tipc_nametbl_withdraw(TIPC_CFG_SRV, tipc_own_addr, 0, tipc_own_addr);
write_lock_bh(&tipc_net_lock); write_lock_bh(&tipc_net_lock);
tipc_bearer_stop(); tipc_bearer_stop();
tipc_bclink_stop(); tipc_bclink_stop();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册