aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-07-16 16:54:21 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-20 23:41:14 -0400
commitd39bbd445dc44259c77bbbc8aadcce7dcdba39cc (patch)
treec82e8d60ae0426c7e0605374e285bf606fdd4ed8 /net/tipc/link.h
parentd3a43b907ae688af6cb753c53cd7de05f3c1ba85 (diff)
tipc: move link input queue to tipc_node
At present, the link input queue and the name distributor receive queues are fields aggregated in struct tipc_link. This is a hazard, because a link might be deleted while a receiving socket still keeps reference to one of the queues. This commit fixes this bug. However, rather than adding yet another reference counter to the critical data path, we move the two queues to safe ground inside struct tipc_node, which is already protected, and let the link code only handle references to the queues. This is also in line with planned later changes in this area. 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/link.h')
-rw-r--r--net/tipc/link.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/tipc/link.h b/net/tipc/link.h
index ae0a0ea572f2..9c71d9e42e93 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -192,8 +192,8 @@ struct tipc_link {
192 u16 rcv_nxt; 192 u16 rcv_nxt;
193 u32 rcv_unacked; 193 u32 rcv_unacked;
194 struct sk_buff_head deferdq; 194 struct sk_buff_head deferdq;
195 struct sk_buff_head inputq; 195 struct sk_buff_head *inputq;
196 struct sk_buff_head namedq; 196 struct sk_buff_head *namedq;
197 197
198 /* Congestion handling */ 198 /* Congestion handling */
199 struct sk_buff_head wakeupq; 199 struct sk_buff_head wakeupq;
@@ -207,9 +207,11 @@ struct tipc_link {
207 207
208struct tipc_port; 208struct tipc_port;
209 209
210struct tipc_link *tipc_link_create(struct tipc_node *n_ptr, 210struct tipc_link *tipc_link_create(struct tipc_node *n,
211 struct tipc_bearer *b_ptr, 211 struct tipc_bearer *b,
212 const struct tipc_media_addr *media_addr); 212 const struct tipc_media_addr *maddr,
213 struct sk_buff_head *inputq,
214 struct sk_buff_head *namedq);
213void tipc_link_delete(struct tipc_link *link); 215void tipc_link_delete(struct tipc_link *link);
214void tipc_link_delete_list(struct net *net, unsigned int bearer_id); 216void tipc_link_delete_list(struct net *net, unsigned int bearer_id);
215void tipc_link_failover_send_queue(struct tipc_link *l_ptr); 217void tipc_link_failover_send_queue(struct tipc_link *l_ptr);