diff options
author | Jon Maloy <jon.maloy@ericsson.com> | 2018-07-06 14:10:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-07 06:49:01 -0400 |
commit | e415577f57f4452150642500364cbe5fa6112813 (patch) | |
tree | 29a53dc5c39cf8d33163fa5d47bceea50eb22bc6 | |
parent | 2a57f182420174c7fd4b19db979a2d135231a963 (diff) |
tipc: correct discovery message handling during address trial period
With the duplicate address discovery protocol for tipc nodes addresses
we introduced a one second trial period before a node is allocated a
hash number to use as address.
Unfortunately, we miss to handle the case when a regular LINK REQUEST/
RESPONSE arrives from a cluster node during the trial period. Such
messages are not ignored as they should be, leading to links setup
attempts while the node still has no address.
Fixes: 25b0b9c4e835 ("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>
-rw-r--r-- | net/tipc/discover.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 9f666e0650e2..dcadc10dffd1 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -133,6 +133,8 @@ static void disc_dupl_alert(struct tipc_bearer *b, u32 node_addr, | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /* tipc_disc_addr_trial(): - handle an address uniqueness trial from peer | 135 | /* tipc_disc_addr_trial(): - handle an address uniqueness trial from peer |
136 | * Returns true if message should be dropped by caller, i.e., if it is a | ||
137 | * trial message or we are inside trial period. Otherwise false. | ||
136 | */ | 138 | */ |
137 | static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d, | 139 | static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d, |
138 | struct tipc_media_addr *maddr, | 140 | struct tipc_media_addr *maddr, |
@@ -168,8 +170,9 @@ static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d, | |||
168 | msg_set_type(buf_msg(d->skb), DSC_REQ_MSG); | 170 | msg_set_type(buf_msg(d->skb), DSC_REQ_MSG); |
169 | } | 171 | } |
170 | 172 | ||
173 | /* Accept regular link requests/responses only after trial period */ | ||
171 | if (mtyp != DSC_TRIAL_MSG) | 174 | if (mtyp != DSC_TRIAL_MSG) |
172 | return false; | 175 | return trial; |
173 | 176 | ||
174 | sugg_addr = tipc_node_try_addr(net, peer_id, src); | 177 | sugg_addr = tipc_node_try_addr(net, peer_id, src); |
175 | if (sugg_addr) | 178 | if (sugg_addr) |