From ca9cf06a0654fcf4b114a5a2d08723fc45d00317 Mon Sep 17 00:00:00 2001 From: Ying Xue Date: Thu, 8 May 2014 08:54:40 +0800 Subject: [PATCH] tipc: don't directly overwrite node action_flags 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 Reviewed-by: Jon Maloy Signed-off-by: David S. Miller --- net/tipc/link.c | 2 +- net/tipc/node.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index 26abb16e86ab..2140837fbab9 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -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); diff --git a/net/tipc/node.c b/net/tipc/node.c index bb66a268b139..facd5611e785 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -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) -- 2.11.0