]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix unexpected link reset due to discovery messages
authorTung Nguyen <tung.q.nguyen@dektech.com.au>
Thu, 5 Jan 2023 06:02:51 +0000 (06:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:42:04 +0000 (11:42 +0100)
commiteda6d3115015de3c7c569ea8ac6e1052ee4d2fea
tree7fa2cbe86ef919186e036f036bf73eba33ab65af
parentecb245b76ad598e3a3eb9eddb135fa10aee40bfc
tipc: fix unexpected link reset due to discovery messages

[ Upstream commit c244c092f1ed2acfb5af3d3da81e22367d3dd733 ]

This unexpected behavior is observed:

node 1                    | node 2
------                    | ------
link is established       | link is established
reboot                    | link is reset
up                        | send discovery message
receive discovery message |
link is established       | link is established
send discovery message    |
                          | receive discovery message
                          | link is reset (unexpected)
                          | send reset message
link is reset             |

It is due to delayed re-discovery as described in function
tipc_node_check_dest(): "this link endpoint has already reset
and re-established contact with the peer, before receiving a
discovery message from that node."

However, commit 130c4e7a8c19 has changed the condition for calling
tipc_node_link_down() which was the acceptance of new media address.

This commit fixes this by restoring the old and correct behavior.

Fixes: 130c4e7a8c19 ("tipc: make resetting of links non-atomic")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tipc/node.c