diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-02-05 08:36:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-05 19:00:03 -0500 |
commit | cb1b728096f54e7408d60fb571944bed00c5b771 (patch) | |
tree | 1b1e50e705f4ddd3b36a43ac9067538db3e8233f /net/tipc/bcast.h | |
parent | 3c724acdd5049907555a831f814bfd5927c3350c (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/bcast.h')
-rw-r--r-- | net/tipc/bcast.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index 8f4d4dc38e11..a910c0b9f249 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h | |||
@@ -97,6 +97,8 @@ struct tipc_bclink { | |||
97 | struct tipc_link link; | 97 | struct tipc_link link; |
98 | struct tipc_node node; | 98 | struct tipc_node node; |
99 | unsigned int flags; | 99 | unsigned int flags; |
100 | struct sk_buff_head arrvq; | ||
101 | struct sk_buff_head inputq; | ||
100 | struct tipc_node_map bcast_nodes; | 102 | struct tipc_node_map bcast_nodes; |
101 | struct tipc_node *retransmit_to; | 103 | struct tipc_node *retransmit_to; |
102 | }; | 104 | }; |
@@ -134,5 +136,6 @@ uint tipc_bclink_get_mtu(void); | |||
134 | int tipc_bclink_xmit(struct net *net, struct sk_buff_head *list); | 136 | int tipc_bclink_xmit(struct net *net, struct sk_buff_head *list); |
135 | void tipc_bclink_wakeup_users(struct net *net); | 137 | void tipc_bclink_wakeup_users(struct net *net); |
136 | int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg); | 138 | int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg); |
139 | void tipc_bclink_input(struct net *net); | ||
137 | 140 | ||
138 | #endif | 141 | #endif |