tipc: update mon's self addr when node addr generated
authorHoang Le <hoang.h.le@dektech.com.au>
Tue, 12 Nov 2019 00:40:04 +0000 (07:40 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:49:52 +0000 (14:49 +0100)
commit295c9b554f6dfcd2d368fae6e6fa22ee5b79c123
tree27f7ce5d5aa0511ab60a49fd08ee8d0ecdcaa373
parentd3c004899ebc7cbd643f66f537aa653faf64869b
tipc: update mon's self addr when node addr generated

commit 46cb01eeeb86fca6afe24dda1167b0cb95424e29 upstream.

In commit 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address
hash values"), the 32-bit node address only generated after one second
trial period expired. However the self's addr in struct tipc_monitor do
not update according to node address generated. This lead to it is
always zero as initial value. As result, sorting algorithm using this
value does not work as expected, neither neighbor monitoring framework.

In this commit, we add a fix to update self's addr when 32-bit node
address generated.

Fixes: 25b0b9c4e835 ("tipc: handle collisions of 32-bit node address hash values")
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/monitor.c
net/tipc/monitor.h
net/tipc/net.c