aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-02-05 08:36:44 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-05 19:00:03 -0500
commitcb1b728096f54e7408d60fb571944bed00c5b771 (patch)
tree1b1e50e705f4ddd3b36a43ac9067538db3e8233f /net/tipc/node.c
parent3c724acdd5049907555a831f814bfd5927c3350c (diff)
tipc: eliminate race condition at multicast reception
In a previous commit in this series we resolved a race problem during unicast message reception. Here, we resolve the same problem at multicast reception. We apply the same technique: an input queue serializing the delivery of arriving buffers. The main difference is that here we do it in two steps. First, the broadcast link feeds arriving buffers into the tail of an arrival queue, which head is consumed at the socket level, and where destination lookup is performed. Second, if the lookup is successful, the resulting buffer clones are fed into a second queue, the input queue. This queue is consumed at reception in the socket just like in the unicast case. Both queues are protected by the same lock, -the one of the input queue. Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index c7fdf3dec92c..52308498f208 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -582,10 +582,10 @@ void tipc_node_unlock(struct tipc_node *node)
582 namedq = node->namedq; 582 namedq = node->namedq;
583 publ_list = &node->publ_list; 583 publ_list = &node->publ_list;
584 584
585 node->action_flags &= ~(TIPC_MSG_EVT | TIPC_NOTIFY_NODE_DOWN | 585 node->action_flags &= ~(TIPC_MSG_EVT |
586 TIPC_NOTIFY_NODE_UP | TIPC_NOTIFY_LINK_UP | 586 TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |
587 TIPC_NOTIFY_LINK_DOWN | 587 TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP |
588 TIPC_WAKEUP_BCAST_USERS | 588 TIPC_WAKEUP_BCAST_USERS | TIPC_BCAST_MSG_EVT |
589 TIPC_NAMED_MSG_EVT); 589 TIPC_NAMED_MSG_EVT);
590 590
591 spin_unlock_bh(&node->lock); 591 spin_unlock_bh(&node->lock);
@@ -612,6 +612,9 @@ void tipc_node_unlock(struct tipc_node *node)
612 612
613 if (flags & TIPC_NAMED_MSG_EVT) 613 if (flags & TIPC_NAMED_MSG_EVT)
614 tipc_named_rcv(net, namedq); 614 tipc_named_rcv(net, namedq);
615
616 if (flags & TIPC_BCAST_MSG_EVT)
617 tipc_bclink_input(net);
615} 618}
616 619
617/* Caller should hold node lock for the passed node */ 620/* Caller should hold node lock for the passed node */