Skip to content

Commit

Permalink
tipc: correct discovery message handling during address trial period
Browse files Browse the repository at this point in the history
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: 25b0b9c ("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>
  • Loading branch information
Jon Maloy authored and davem330 committed Jul 7, 2018
1 parent 2a57f18 commit e415577
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/tipc/discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static void disc_dupl_alert(struct tipc_bearer *b, u32 node_addr,
}

/* tipc_disc_addr_trial(): - handle an address uniqueness trial from peer
* Returns true if message should be dropped by caller, i.e., if it is a
* trial message or we are inside trial period. Otherwise false.
*/
static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d,
struct tipc_media_addr *maddr,
Expand Down Expand Up @@ -168,8 +170,9 @@ static bool tipc_disc_addr_trial_msg(struct tipc_discoverer *d,
msg_set_type(buf_msg(d->skb), DSC_REQ_MSG);
}

/* Accept regular link requests/responses only after trial period */
if (mtyp != DSC_TRIAL_MSG)
return false;
return trial;

sugg_addr = tipc_node_try_addr(net, peer_id, src);
if (sugg_addr)
Expand Down

0 comments on commit e415577

Please sign in to comment.