Blame view

net/rxrpc/conn_event.c 10.5 KB
17926a793   David Howells   [AF_RXRPC]: Provi...
1
2
3
4
5
6
7
8
9
10
  /* connection-level event handling
   *
   * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
   * Written by David Howells (dhowells@redhat.com)
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
   * as published by the Free Software Foundation; either version
   * 2 of the License, or (at your option) any later version.
   */
9b6d53985   Joe Perches   rxrpc: Use pr_<le...
11
  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17926a793   David Howells   [AF_RXRPC]: Provi...
12
13
14
15
  #include <linux/module.h>
  #include <linux/net.h>
  #include <linux/skbuff.h>
  #include <linux/errqueue.h>
17926a793   David Howells   [AF_RXRPC]: Provi...
16
17
18
19
20
21
  #include <net/sock.h>
  #include <net/af_rxrpc.h>
  #include <net/ip.h>
  #include "ar-internal.h"
  
  /*
18bfeba50   David Howells   rxrpc: Perform te...
22
23
   * Retransmit terminal ACK or ABORT of the previous call.
   */
f5c17aaeb   David Howells   rxrpc: Calls shou...
24
25
  static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
  				       struct sk_buff *skb)
18bfeba50   David Howells   rxrpc: Perform te...
26
27
28
29
30
31
32
33
34
35
36
37
38
  {
  	struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
  	struct rxrpc_channel *chan;
  	struct msghdr msg;
  	struct kvec iov;
  	struct {
  		struct rxrpc_wire_header whdr;
  		union {
  			struct {
  				__be32 code;
  			} abort;
  			struct {
  				struct rxrpc_ackpacket ack;
2266ffdef   David Howells   rxrpc: Fix conn-b...
39
  				u8 padding[3];
18bfeba50   David Howells   rxrpc: Perform te...
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  				struct rxrpc_ackinfo info;
  			};
  		};
  	} __attribute__((packed)) pkt;
  	size_t len;
  	u32 serial, mtu, call_id;
  
  	_enter("%d", conn->debug_id);
  
  	chan = &conn->channels[sp->hdr.cid & RXRPC_CHANNELMASK];
  
  	/* If the last call got moved on whilst we were waiting to run, just
  	 * ignore this packet.
  	 */
  	call_id = READ_ONCE(chan->last_call);
  	/* Sync with __rxrpc_disconnect_call() */
  	smp_rmb();
  	if (call_id != sp->hdr.callNumber)
  		return;
  
  	msg.msg_name	= &conn->params.peer->srx.transport;
  	msg.msg_namelen	= conn->params.peer->srx.transport_len;
  	msg.msg_control	= NULL;
  	msg.msg_controllen = 0;
  	msg.msg_flags	= 0;
  
  	pkt.whdr.epoch		= htonl(sp->hdr.epoch);
  	pkt.whdr.cid		= htonl(sp->hdr.cid);
  	pkt.whdr.callNumber	= htonl(sp->hdr.callNumber);
  	pkt.whdr.seq		= 0;
  	pkt.whdr.type		= chan->last_type;
  	pkt.whdr.flags		= conn->out_clientflag;
  	pkt.whdr.userStatus	= 0;
  	pkt.whdr.securityIndex	= conn->security_ix;
  	pkt.whdr._rsvd		= 0;
68d6d1ae5   David Howells   rxrpc: Separate t...
75
  	pkt.whdr.serviceId	= htons(conn->service_id);
18bfeba50   David Howells   rxrpc: Perform te...
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  
  	len = sizeof(pkt.whdr);
  	switch (chan->last_type) {
  	case RXRPC_PACKET_TYPE_ABORT:
  		pkt.abort.code	= htonl(chan->last_abort);
  		len += sizeof(pkt.abort);
  		break;
  
  	case RXRPC_PACKET_TYPE_ACK:
  		mtu = conn->params.peer->if_mtu;
  		mtu -= conn->params.peer->hdrsize;
  		pkt.ack.bufferSpace	= 0;
  		pkt.ack.maxSkew		= htons(skb->priority);
  		pkt.ack.firstPacket	= htonl(chan->last_seq);
  		pkt.ack.previousPacket	= htonl(chan->last_seq - 1);
  		pkt.ack.serial		= htonl(sp->hdr.serial);
  		pkt.ack.reason		= RXRPC_ACK_DUPLICATE;
  		pkt.ack.nAcks		= 0;
  		pkt.info.rxMTU		= htonl(rxrpc_rx_mtu);
  		pkt.info.maxMTU		= htonl(mtu);
  		pkt.info.rwind		= htonl(rxrpc_rx_window_size);
  		pkt.info.jumbo_max	= htonl(rxrpc_rx_jumbo_max);
57494343c   David Howells   rxrpc: Implement ...
98
  		pkt.whdr.flags		|= RXRPC_SLOW_START_OK;
18bfeba50   David Howells   rxrpc: Perform te...
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  		len += sizeof(pkt.ack) + sizeof(pkt.info);
  		break;
  	}
  
  	/* Resync with __rxrpc_disconnect_call() and check that the last call
  	 * didn't get advanced whilst we were filling out the packets.
  	 */
  	smp_rmb();
  	if (READ_ONCE(chan->last_call) != call_id)
  		return;
  
  	iov.iov_base	= &pkt;
  	iov.iov_len	= len;
  
  	serial = atomic_inc_return(&conn->serial);
  	pkt.whdr.serial = htonl(serial);
  
  	switch (chan->last_type) {
  	case RXRPC_PACKET_TYPE_ABORT:
252869e5f   David Howells   rxrpc: Fix connec...
118
  		_proto("Tx ABORT %%%u { %d } [re]", serial, conn->abort_code);
18bfeba50   David Howells   rxrpc: Perform te...
119
120
  		break;
  	case RXRPC_PACKET_TYPE_ACK:
be832aecc   David Howells   rxrpc: Add data T...
121
122
  		trace_rxrpc_tx_ack(NULL, serial, chan->last_seq, 0,
  				   RXRPC_ACK_DUPLICATE, 0);
18bfeba50   David Howells   rxrpc: Perform te...
123
124
125
126
127
128
129
130
131
132
  		_proto("Tx ACK %%%u [re]", serial);
  		break;
  	}
  
  	kernel_sendmsg(conn->params.local->socket, &msg, &iov, 1, len);
  	_leave("");
  	return;
  }
  
  /*
17926a793   David Howells   [AF_RXRPC]: Provi...
133
134
   * pass a connection-level abort onto all calls on that connection
   */
f5c17aaeb   David Howells   rxrpc: Calls shou...
135
  static void rxrpc_abort_calls(struct rxrpc_connection *conn,
252869e5f   David Howells   rxrpc: Fix connec...
136
  			      enum rxrpc_call_completion compl)
17926a793   David Howells   [AF_RXRPC]: Provi...
137
138
  {
  	struct rxrpc_call *call;
248f219cb   David Howells   rxrpc: Rewrite th...
139
  	int i;
17926a793   David Howells   [AF_RXRPC]: Provi...
140

252869e5f   David Howells   rxrpc: Fix connec...
141
  	_enter("{%d},%x", conn->debug_id, conn->abort_code);
17926a793   David Howells   [AF_RXRPC]: Provi...
142

a1399f8bb   David Howells   rxrpc: Call chann...
143
  	spin_lock(&conn->channel_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
144

a1399f8bb   David Howells   rxrpc: Call chann...
145
146
147
148
  	for (i = 0; i < RXRPC_MAXCALLS; i++) {
  		call = rcu_dereference_protected(
  			conn->channels[i].call,
  			lockdep_is_held(&conn->channel_lock));
ccbd3dbe8   David Howells   rxrpc: Fix a pote...
149
  		if (call) {
5a42976d4   David Howells   rxrpc: Add tracep...
150
151
152
  			if (compl == RXRPC_CALL_LOCALLY_ABORTED)
  				trace_rxrpc_abort("CON", call->cid,
  						  call->call_id, 0,
252869e5f   David Howells   rxrpc: Fix connec...
153
154
  						  conn->abort_code,
  						  conn->error);
248f219cb   David Howells   rxrpc: Rewrite th...
155
  			if (rxrpc_set_call_completion(call, compl,
252869e5f   David Howells   rxrpc: Fix connec...
156
157
  						      conn->abort_code,
  						      conn->error))
248f219cb   David Howells   rxrpc: Rewrite th...
158
  				rxrpc_notify_socket(call);
17926a793   David Howells   [AF_RXRPC]: Provi...
159
  		}
17926a793   David Howells   [AF_RXRPC]: Provi...
160
  	}
a1399f8bb   David Howells   rxrpc: Call chann...
161
  	spin_unlock(&conn->channel_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
162
163
164
165
166
167
168
  	_leave("");
  }
  
  /*
   * generate a connection-level abort
   */
  static int rxrpc_abort_connection(struct rxrpc_connection *conn,
3a92789af   David Howells   rxrpc: Use negati...
169
  				  int error, u32 abort_code)
17926a793   David Howells   [AF_RXRPC]: Provi...
170
  {
0d12f8a40   David Howells   rxrpc: Keep the s...
171
  	struct rxrpc_wire_header whdr;
17926a793   David Howells   [AF_RXRPC]: Provi...
172
173
174
175
  	struct msghdr msg;
  	struct kvec iov[2];
  	__be32 word;
  	size_t len;
0d12f8a40   David Howells   rxrpc: Keep the s...
176
  	u32 serial;
17926a793   David Howells   [AF_RXRPC]: Provi...
177
178
179
180
181
182
  	int ret;
  
  	_enter("%d,,%u,%u", conn->debug_id, error, abort_code);
  
  	/* generate a connection-level abort */
  	spin_lock_bh(&conn->state_lock);
f5c17aaeb   David Howells   rxrpc: Calls shou...
183
  	if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
17926a793   David Howells   [AF_RXRPC]: Provi...
184
185
186
187
  		spin_unlock_bh(&conn->state_lock);
  		_leave(" = 0 [already dead]");
  		return 0;
  	}
252869e5f   David Howells   rxrpc: Fix connec...
188
189
  	conn->error = error;
  	conn->abort_code = abort_code;
f5c17aaeb   David Howells   rxrpc: Calls shou...
190
191
  	conn->state = RXRPC_CONN_LOCALLY_ABORTED;
  	spin_unlock_bh(&conn->state_lock);
252869e5f   David Howells   rxrpc: Fix connec...
192
  	rxrpc_abort_calls(conn, RXRPC_CALL_LOCALLY_ABORTED);
17926a793   David Howells   [AF_RXRPC]: Provi...
193

85f32278b   David Howells   rxrpc: Replace co...
194
195
  	msg.msg_name	= &conn->params.peer->srx.transport;
  	msg.msg_namelen	= conn->params.peer->srx.transport_len;
17926a793   David Howells   [AF_RXRPC]: Provi...
196
197
198
  	msg.msg_control	= NULL;
  	msg.msg_controllen = 0;
  	msg.msg_flags	= 0;
19ffa01c9   David Howells   rxrpc: Use struct...
199
200
  	whdr.epoch	= htonl(conn->proto.epoch);
  	whdr.cid	= htonl(conn->proto.cid);
0d12f8a40   David Howells   rxrpc: Keep the s...
201
202
203
204
205
206
207
  	whdr.callNumber	= 0;
  	whdr.seq	= 0;
  	whdr.type	= RXRPC_PACKET_TYPE_ABORT;
  	whdr.flags	= conn->out_clientflag;
  	whdr.userStatus	= 0;
  	whdr.securityIndex = conn->security_ix;
  	whdr._rsvd	= 0;
68d6d1ae5   David Howells   rxrpc: Separate t...
208
  	whdr.serviceId	= htons(conn->service_id);
17926a793   David Howells   [AF_RXRPC]: Provi...
209

252869e5f   David Howells   rxrpc: Fix connec...
210
  	word		= htonl(conn->abort_code);
17926a793   David Howells   [AF_RXRPC]: Provi...
211

0d12f8a40   David Howells   rxrpc: Keep the s...
212
213
  	iov[0].iov_base	= &whdr;
  	iov[0].iov_len	= sizeof(whdr);
17926a793   David Howells   [AF_RXRPC]: Provi...
214
215
216
217
  	iov[1].iov_base	= &word;
  	iov[1].iov_len	= sizeof(word);
  
  	len = iov[0].iov_len + iov[1].iov_len;
0d12f8a40   David Howells   rxrpc: Keep the s...
218
219
  	serial = atomic_inc_return(&conn->serial);
  	whdr.serial = htonl(serial);
252869e5f   David Howells   rxrpc: Fix connec...
220
  	_proto("Tx CONN ABORT %%%u { %d }", serial, conn->abort_code);
17926a793   David Howells   [AF_RXRPC]: Provi...
221

85f32278b   David Howells   rxrpc: Replace co...
222
  	ret = kernel_sendmsg(conn->params.local->socket, &msg, iov, 2, len);
17926a793   David Howells   [AF_RXRPC]: Provi...
223
224
225
226
227
228
229
230
231
232
233
  	if (ret < 0) {
  		_debug("sendmsg failed: %d", ret);
  		return -EAGAIN;
  	}
  
  	_leave(" = 0");
  	return 0;
  }
  
  /*
   * mark a call as being on a now-secured channel
248f219cb   David Howells   rxrpc: Rewrite th...
234
   * - must be called with BH's disabled.
17926a793   David Howells   [AF_RXRPC]: Provi...
235
   */
5eaa65b24   Roel Kluin   net: Make static
236
  static void rxrpc_call_is_secure(struct rxrpc_call *call)
17926a793   David Howells   [AF_RXRPC]: Provi...
237
238
239
  {
  	_enter("%p", call);
  	if (call) {
248f219cb   David Howells   rxrpc: Rewrite th...
240
241
242
243
244
245
  		write_lock_bh(&call->state_lock);
  		if (call->state == RXRPC_CALL_SERVER_SECURING) {
  			call->state = RXRPC_CALL_SERVER_ACCEPTING;
  			rxrpc_notify_socket(call);
  		}
  		write_unlock_bh(&call->state_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
246
247
248
249
250
251
252
253
254
255
256
  	}
  }
  
  /*
   * connection-level Rx packet processor
   */
  static int rxrpc_process_event(struct rxrpc_connection *conn,
  			       struct sk_buff *skb,
  			       u32 *_abort_code)
  {
  	struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
0d12f8a40   David Howells   rxrpc: Keep the s...
257
258
  	__be32 wtmp;
  	u32 abort_code;
17926a793   David Howells   [AF_RXRPC]: Provi...
259
  	int loop, ret;
519d25679   David Howells   RxRPC: Don't atte...
260
  	if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
248f219cb   David Howells   rxrpc: Rewrite th...
261
  		_leave(" = -ECONNABORTED [%u]", conn->state);
17926a793   David Howells   [AF_RXRPC]: Provi...
262
  		return -ECONNABORTED;
519d25679   David Howells   RxRPC: Don't atte...
263
  	}
17926a793   David Howells   [AF_RXRPC]: Provi...
264

0d12f8a40   David Howells   rxrpc: Keep the s...
265
  	_enter("{%d},{%u,%%%u},", conn->debug_id, sp->hdr.type, sp->hdr.serial);
519d25679   David Howells   RxRPC: Don't atte...
266

17926a793   David Howells   [AF_RXRPC]: Provi...
267
  	switch (sp->hdr.type) {
18bfeba50   David Howells   rxrpc: Perform te...
268
269
  	case RXRPC_PACKET_TYPE_DATA:
  	case RXRPC_PACKET_TYPE_ACK:
f5c17aaeb   David Howells   rxrpc: Calls shou...
270
  		rxrpc_conn_retransmit_call(conn, skb);
18bfeba50   David Howells   rxrpc: Perform te...
271
  		return 0;
4d4a6ac73   David Howells   rxrpc: Ignore BUS...
272
273
274
  	case RXRPC_PACKET_TYPE_BUSY:
  		/* Just ignore BUSY packets for now. */
  		return 0;
17926a793   David Howells   [AF_RXRPC]: Provi...
275
  	case RXRPC_PACKET_TYPE_ABORT:
775e5b71d   David Howells   rxrpc: The offset...
276
  		if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
fb46f6ee1   David Howells   rxrpc: Trace prot...
277
278
279
  				  &wtmp, sizeof(wtmp)) < 0) {
  			trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
  					      tracepoint_string("bad_abort"));
17926a793   David Howells   [AF_RXRPC]: Provi...
280
  			return -EPROTO;
fb46f6ee1   David Howells   rxrpc: Trace prot...
281
  		}
0d12f8a40   David Howells   rxrpc: Keep the s...
282
283
  		abort_code = ntohl(wtmp);
  		_proto("Rx ABORT %%%u { ac=%d }", sp->hdr.serial, abort_code);
17926a793   David Howells   [AF_RXRPC]: Provi...
284

252869e5f   David Howells   rxrpc: Fix connec...
285
286
  		conn->error = -ECONNABORTED;
  		conn->abort_code = abort_code;
17926a793   David Howells   [AF_RXRPC]: Provi...
287
  		conn->state = RXRPC_CONN_REMOTELY_ABORTED;
252869e5f   David Howells   rxrpc: Fix connec...
288
  		rxrpc_abort_calls(conn, RXRPC_CALL_REMOTELY_ABORTED);
17926a793   David Howells   [AF_RXRPC]: Provi...
289
290
291
  		return -ECONNABORTED;
  
  	case RXRPC_PACKET_TYPE_CHALLENGE:
e0e4d82f3   David Howells   rxrpc: Create a n...
292
293
  		return conn->security->respond_to_challenge(conn, skb,
  							    _abort_code);
17926a793   David Howells   [AF_RXRPC]: Provi...
294
295
  
  	case RXRPC_PACKET_TYPE_RESPONSE:
17926a793   David Howells   [AF_RXRPC]: Provi...
296
297
298
299
300
301
302
  		ret = conn->security->verify_response(conn, skb, _abort_code);
  		if (ret < 0)
  			return ret;
  
  		ret = conn->security->init_connection_security(conn);
  		if (ret < 0)
  			return ret;
a263629da   Herbert Xu   rxrpc: Avoid usin...
303
304
305
  		ret = conn->security->prime_packet_security(conn);
  		if (ret < 0)
  			return ret;
a1399f8bb   David Howells   rxrpc: Call chann...
306
  		spin_lock(&conn->channel_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
307
  		spin_lock(&conn->state_lock);
bba304db3   David Howells   rxrpc: Turn conne...
308
309
  		if (conn->state == RXRPC_CONN_SERVICE_CHALLENGING) {
  			conn->state = RXRPC_CONN_SERVICE;
248f219cb   David Howells   rxrpc: Rewrite th...
310
  			spin_unlock(&conn->state_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
311
  			for (loop = 0; loop < RXRPC_MAXCALLS; loop++)
dee46364c   David Howells   rxrpc: Add RCU de...
312
313
  				rxrpc_call_is_secure(
  					rcu_dereference_protected(
a1399f8bb   David Howells   rxrpc: Call chann...
314
315
  						conn->channels[loop].call,
  						lockdep_is_held(&conn->channel_lock)));
248f219cb   David Howells   rxrpc: Rewrite th...
316
317
  		} else {
  			spin_unlock(&conn->state_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
318
  		}
a1399f8bb   David Howells   rxrpc: Call chann...
319
  		spin_unlock(&conn->channel_lock);
17926a793   David Howells   [AF_RXRPC]: Provi...
320
321
322
  		return 0;
  
  	default:
fb46f6ee1   David Howells   rxrpc: Trace prot...
323
324
  		trace_rxrpc_rx_eproto(NULL, sp->hdr.serial,
  				      tracepoint_string("bad_conn_pkt"));
17926a793   David Howells   [AF_RXRPC]: Provi...
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
  		return -EPROTO;
  	}
  }
  
  /*
   * set up security and issue a challenge
   */
  static void rxrpc_secure_connection(struct rxrpc_connection *conn)
  {
  	u32 abort_code;
  	int ret;
  
  	_enter("{%d}", conn->debug_id);
  
  	ASSERT(conn->security_ix != 0);
19ffa01c9   David Howells   rxrpc: Use struct...
340
  	if (!conn->params.key) {
17926a793   David Howells   [AF_RXRPC]: Provi...
341
342
343
344
345
346
347
348
349
350
351
352
353
  		_debug("set up security");
  		ret = rxrpc_init_server_conn_security(conn);
  		switch (ret) {
  		case 0:
  			break;
  		case -ENOENT:
  			abort_code = RX_CALL_DEAD;
  			goto abort;
  		default:
  			abort_code = RXKADNOAUTH;
  			goto abort;
  		}
  	}
17926a793   David Howells   [AF_RXRPC]: Provi...
354
355
356
357
358
359
360
361
362
363
364
  	if (conn->security->issue_challenge(conn) < 0) {
  		abort_code = RX_CALL_DEAD;
  		ret = -ENOMEM;
  		goto abort;
  	}
  
  	_leave("");
  	return;
  
  abort:
  	_debug("abort %d, %d", ret, abort_code);
3a92789af   David Howells   rxrpc: Use negati...
365
  	rxrpc_abort_connection(conn, ret, abort_code);
17926a793   David Howells   [AF_RXRPC]: Provi...
366
367
368
369
370
371
372
373
374
375
  	_leave(" [aborted]");
  }
  
  /*
   * connection-level event processor
   */
  void rxrpc_process_connection(struct work_struct *work)
  {
  	struct rxrpc_connection *conn =
  		container_of(work, struct rxrpc_connection, processor);
17926a793   David Howells   [AF_RXRPC]: Provi...
376
377
378
  	struct sk_buff *skb;
  	u32 abort_code = RX_PROTOCOL_ERROR;
  	int ret;
363deeab6   David Howells   rxrpc: Add connec...
379
  	rxrpc_see_connection(conn);
17926a793   David Howells   [AF_RXRPC]: Provi...
380

2c4579e4b   David Howells   rxrpc: Move usage...
381
  	if (test_and_clear_bit(RXRPC_CONN_EV_CHALLENGE, &conn->events))
17926a793   David Howells   [AF_RXRPC]: Provi...
382
  		rxrpc_secure_connection(conn);
17926a793   David Howells   [AF_RXRPC]: Provi...
383
384
385
386
  
  	/* go through the conn-level event packets, releasing the ref on this
  	 * connection that each one has when we've finished with it */
  	while ((skb = skb_dequeue(&conn->rx_queue))) {
71f3ca408   David Howells   rxrpc: Improve sk...
387
  		rxrpc_see_skb(skb, rxrpc_skb_rx_seen);
17926a793   David Howells   [AF_RXRPC]: Provi...
388
389
390
391
392
393
  		ret = rxrpc_process_event(conn, skb, &abort_code);
  		switch (ret) {
  		case -EPROTO:
  		case -EKEYEXPIRED:
  		case -EKEYREJECTED:
  			goto protocol_error;
e781fff7b   David Howells   rxrpc: Don't put ...
394
  		case -ENOMEM:
17926a793   David Howells   [AF_RXRPC]: Provi...
395
396
397
398
  		case -EAGAIN:
  			goto requeue_and_leave;
  		case -ECONNABORTED:
  		default:
71f3ca408   David Howells   rxrpc: Improve sk...
399
  			rxrpc_free_skb(skb, rxrpc_skb_rx_freed);
17926a793   David Howells   [AF_RXRPC]: Provi...
400
401
402
403
404
405
406
407
408
409
410
411
412
413
  			break;
  		}
  	}
  
  out:
  	rxrpc_put_connection(conn);
  	_leave("");
  	return;
  
  requeue_and_leave:
  	skb_queue_head(&conn->rx_queue, skb);
  	goto out;
  
  protocol_error:
3a92789af   David Howells   rxrpc: Use negati...
414
  	if (rxrpc_abort_connection(conn, ret, abort_code) < 0)
17926a793   David Howells   [AF_RXRPC]: Provi...
415
  		goto requeue_and_leave;
71f3ca408   David Howells   rxrpc: Improve sk...
416
  	rxrpc_free_skb(skb, rxrpc_skb_rx_freed);
17926a793   David Howells   [AF_RXRPC]: Provi...
417
418
  	goto out;
  }