Skip to content

Commit

Permalink
tipc: don't directly overwrite node action_flags
Browse files Browse the repository at this point in the history
Each node action flag should be set or cleared separately, instead
we now set the whole flags variable in one shot, and it's turned
out to be hard to see which other flags are affected. Therefore,
for instance, we explicitly clear TIPC_WAIT_OWN_LINKS_DOWN bit in
node_lost_contact().

Signed-off-by: Ying Xue <[email protected]>
Reviewed-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ying-xue authored and davem330 committed May 9, 2014
1 parent aecb9bb commit ca9cf06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr, struct sk_buff *buf)
* peer has lost contact -- don't allow peer's links
* to reactivate before we recognize loss & clean up
*/
l_ptr->owner->action_flags = TIPC_WAIT_OWN_LINKS_DOWN;
l_ptr->owner->action_flags |= TIPC_WAIT_OWN_LINKS_DOWN;
}

link_state_event(l_ptr, RESET_MSG);
Expand Down
6 changes: 4 additions & 2 deletions net/tipc/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,13 @@ static void node_lost_contact(struct tipc_node *n_ptr)
tipc_link_reset_fragments(l_ptr);
}

n_ptr->action_flags &= ~TIPC_WAIT_OWN_LINKS_DOWN;

/* Notify subscribers and prevent re-contact with node until
* cleanup is done.
*/
n_ptr->action_flags = TIPC_WAIT_PEER_LINKS_DOWN |
TIPC_NOTIFY_NODE_DOWN;
n_ptr->action_flags |= TIPC_WAIT_PEER_LINKS_DOWN |
TIPC_NOTIFY_NODE_DOWN;
}

struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
Expand Down

0 comments on commit ca9cf06

Please sign in to comment.