rxrpc: Once packet posted in data_ready, don't retry posting

Once a packet has been posted to a connection in the data_ready handler, we
mustn't try reposting if we then find that the connection is dying as the
refcount has been given over to the dying connection and the packet might
no longer exist.

Losing the packet isn't a problem as the peer will retransmit.

Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells 2016-08-09 10:11:48 +01:00
parent f9dc575725
commit 2e7e9758b2

View file

@ -567,13 +567,13 @@ static void rxrpc_post_packet_to_call(struct rxrpc_call *call,
* post connection-level events to the connection * post connection-level events to the connection
* - this includes challenges, responses and some aborts * - this includes challenges, responses and some aborts
*/ */
static bool rxrpc_post_packet_to_conn(struct rxrpc_connection *conn, static void rxrpc_post_packet_to_conn(struct rxrpc_connection *conn,
struct sk_buff *skb) struct sk_buff *skb)
{ {
_enter("%p,%p", conn, skb); _enter("%p,%p", conn, skb);
skb_queue_tail(&conn->rx_queue, skb); skb_queue_tail(&conn->rx_queue, skb);
return rxrpc_queue_conn(conn); rxrpc_queue_conn(conn);
} }
/* /*
@ -694,7 +694,6 @@ void rxrpc_data_ready(struct sock *sk)
rcu_read_lock(); rcu_read_lock();
retry_find_conn:
conn = rxrpc_find_connection_rcu(local, skb); conn = rxrpc_find_connection_rcu(local, skb);
if (!conn) if (!conn)
goto cant_route_call; goto cant_route_call;
@ -702,8 +701,7 @@ void rxrpc_data_ready(struct sock *sk)
if (sp->hdr.callNumber == 0) { if (sp->hdr.callNumber == 0) {
/* Connection-level packet */ /* Connection-level packet */
_debug("CONN %p {%d}", conn, conn->debug_id); _debug("CONN %p {%d}", conn, conn->debug_id);
if (!rxrpc_post_packet_to_conn(conn, skb)) rxrpc_post_packet_to_conn(conn, skb);
goto retry_find_conn;
} else { } else {
/* Call-bound packets are routed by connection channel. */ /* Call-bound packets are routed by connection channel. */
unsigned int channel = sp->hdr.cid & RXRPC_CHANNELMASK; unsigned int channel = sp->hdr.cid & RXRPC_CHANNELMASK;