]> 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:58:24 +0000 (11:58 +0100)
commit0567d97265a32b68039ebd3e8a679f79699597d8
tree88d6218c1a3bae1b4e6ec4d22c40078888947d97
parent64efa756ae0024b8d7b5fceb64936ac3e0819fe6
tipc: fix unexpected link reset due to discovery messages

[ Upstream commit c5ed8098224f628098599ee4a30aaf0c43df7019 ]

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 bb2627ba5819 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: bb2627ba5819 ("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