From a2cfd45b52006893fc0d0e850d187d30f86a39dc Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Thu, 26 Apr 2012 16:46:29 -0400 Subject: tipc: Optimize re-initialization of configuration service Streamlines the job of re-initializing TIPC's configuration service when a node's network address is first assigned. Rather than destroying the configuration server port and then recreating it, TIPC now simply withdraws the existing {0,<0.0.0>} name publication and creates a new {0,} name publication that identifies the node's network address to interested subscribers. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker --- net/tipc/config.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'net/tipc/config.c') diff --git a/net/tipc/config.c b/net/tipc/config.c index f5458eddd7bc..a4988cdbde6d 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c @@ -489,6 +489,21 @@ failed: return res; } +void tipc_cfg_reinit(void) +{ + struct tipc_name_seq seq; + int res; + + seq.type = TIPC_CFG_SRV; + seq.lower = seq.upper = 0; + tipc_withdraw(config_port_ref, TIPC_ZONE_SCOPE, &seq); + + seq.lower = seq.upper = tipc_own_addr; + res = tipc_publish(config_port_ref, TIPC_ZONE_SCOPE, &seq); + if (res) + err("Unable to reinitialize configuration service\n"); +} + void tipc_cfg_stop(void) { if (config_port_ref) { -- cgit v1.2.3