aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c15
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)
121 121
122void tipc_net_finalize(struct net *net, u32 addr) 122void tipc_net_finalize(struct net *net, u32 addr)
123{ 123{
124 tipc_set_node_addr(net, addr); 124 struct tipc_net *tn = tipc_net(net);
125 smp_mb(); 125
126 tipc_named_reinit(net); 126 if (!cmpxchg(&tn->node_addr, 0, addr)) {
127 tipc_sk_reinit(net); 127 tipc_set_node_addr(net, addr);
128 tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr, 128 tipc_named_reinit(net);
129 TIPC_CLUSTER_SCOPE, 0, addr); 129 tipc_sk_reinit(net);
130 tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr,
131 TIPC_CLUSTER_SCOPE, 0, addr);
132 }
130} 133}
131 134
132void tipc_net_stop(struct net *net) 135void tipc_net_stop(struct net *net)