diff options
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r-- | net/tipc/net.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c index 4fbaa0464405..62199cf5a56c 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -121,12 +121,15 @@ int tipc_net_init(struct net *net, u8 *node_id, u32 addr) void tipc_net_finalize(struct net *net, u32 addr) { - tipc_set_node_addr(net, addr); - smp_mb(); - tipc_named_reinit(net); - tipc_sk_reinit(net); - tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr, - TIPC_CLUSTER_SCOPE, 0, addr); + struct tipc_net *tn = tipc_net(net); + + if (!cmpxchg(&tn->node_addr, 0, addr)) { + tipc_set_node_addr(net, addr); + tipc_named_reinit(net); + tipc_sk_reinit(net); + tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr, + TIPC_CLUSTER_SCOPE, 0, addr); + } } void tipc_net_stop(struct net *net) |