]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix wrong return value from function tipc_node_try_addr()
authorJon Maloy <jon.maloy@ericsson.com>
Fri, 6 Jul 2018 18:10:03 +0000 (20:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jul 2018 10:49:01 +0000 (19:49 +0900)
commit013df6895e78f2c2b450f6a6ed7f807be440662a
tree2995b49645166b4f744bfc775079b00b6f6fdf78
parent0d9b52830e52507024edfb611ec4ee0fdb6ae0fa
tipc: fix wrong return value from function tipc_node_try_addr()

The function for checking if there is an node address conflict is
supposed to return a suggestion for a new address if it finds a
conflict, and zero otherwise. But in case the peer being checked
is previously unknown it does instead return a "suggestion" for
the checked address itself. This results in a DSC_TRIAL_FAIL_MSG
being sent unecessarily to the peer, and sometimes makes the trial
period starting over again.

Fixes: b8bd0db28fc0 ("tipc: handle collisions of 32-bit node address hash values")
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node.c