]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
tipc: don't directly overwrite node action_flags
authorYing Xue <ying.xue@windriver.com>
Thu, 8 May 2014 00:54:40 +0000 (08:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 May 2014 05:41:01 +0000 (01:41 -0400)
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 <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c
net/tipc/node.c

index 26abb16e86abc72c8cf203037f050ed5a1804136..2140837fbab9e4f51c8d99dbafae2810447bde72 100644 (file)
@@ -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);
index bb66a268b1391c915d0051c3427b7773d3559368..facd5611e78517fa9209aa8c2ac06d511c17fa97 100644 (file)
@@ -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)