diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-03-27 10:19:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 13:47:36 -0700 |
commit | d482994fca82380912b3a80201b74d5118ff0487 (patch) | |
tree | 42831f6ce50ea0c79fe958d71d9ec5fd02b51121 /net/tipc/addr.h | |
parent | 4d92a3e9b90e23eaf7d893d1841cd0391403b99a (diff) | |
download | linux-d482994fca82380912b3a80201b74d5118ff0487.tar.bz2 |
tipc: fix two bugs in secondary destination lookup
A message sent to a node after a successful name table lookup may still
find that the destination socket has disappeared, because distribution
of name table updates is non-atomic. If so, the message will be rejected
back to the sender with error code TIPC_ERR_NO_PORT. If the source
socket of the message has disappeared in the meantime, the message
should be dropped.
However, in the currrent code, the message will instead be subject to an
unwanted tertiary lookup, because the function tipc_msg_lookup_dest()
doesn't check if there is an error code present in the message before
performing the lookup. In the worst case, the message may now find the
old destination again, and be redirected once more, instead of being
dropped directly as it should be.
A second bug in this function is that the "prev_node" field in the message
is not updated after successful lookup, something that may have
unpredictable consequences.
The problems arising from those bugs occur very infrequently.
The third change in this function; the test on msg_reroute_msg_cnt() is
purely cosmetic, reflecting that the returned value never can be negative.
This commit corrects the two bugs described above.
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/addr.h')
-rw-r--r-- | net/tipc/addr.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/addr.h b/net/tipc/addr.h index c700c2d28e09..7ba6d5c8ae40 100644 --- a/net/tipc/addr.h +++ b/net/tipc/addr.h @@ -55,6 +55,7 @@ static inline u32 tipc_cluster_mask(u32 addr) return addr & TIPC_CLUSTER_MASK; } +u32 tipc_own_addr(struct net *net); int in_own_cluster(struct net *net, u32 addr); int in_own_cluster_exact(struct net *net, u32 addr); int in_own_node(struct net *net, u32 addr); |