aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2009-06-16 16:36:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 00:20:14 -0400
commit519d25679e8ae7433c758b9e74b19144f61b90f8 (patch)
treee458a5fbf4e37568133fd2488772e98c159fca2b /net/rxrpc
parent0dd5198672dd2bbeb933862e1fc82162e0b636be (diff)
RxRPC: Don't attempt to reuse aborted connections
Connections that have seen a connection-level abort should not be reused as the far end will just abort them again; instead a new connection should be made. Connection-level aborts occur due to such things as authentication failures. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/ar-connection.c10
-rw-r--r--net/rxrpc/ar-connevent.c7
2 files changed, 16 insertions, 1 deletions
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index 67e38a05624..9f1ce841a0b 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -444,6 +444,11 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
444 conn = list_entry(bundle->avail_conns.next, 444 conn = list_entry(bundle->avail_conns.next,
445 struct rxrpc_connection, 445 struct rxrpc_connection,
446 bundle_link); 446 bundle_link);
447 if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
448 list_del_init(&conn->bundle_link);
449 bundle->num_conns--;
450 continue;
451 }
447 if (--conn->avail_calls == 0) 452 if (--conn->avail_calls == 0)
448 list_move(&conn->bundle_link, 453 list_move(&conn->bundle_link,
449 &bundle->busy_conns); 454 &bundle->busy_conns);
@@ -461,6 +466,11 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
461 conn = list_entry(bundle->unused_conns.next, 466 conn = list_entry(bundle->unused_conns.next,
462 struct rxrpc_connection, 467 struct rxrpc_connection,
463 bundle_link); 468 bundle_link);
469 if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
470 list_del_init(&conn->bundle_link);
471 bundle->num_conns--;
472 continue;
473 }
464 ASSERTCMP(conn->avail_calls, ==, RXRPC_MAXCALLS); 474 ASSERTCMP(conn->avail_calls, ==, RXRPC_MAXCALLS);
465 conn->avail_calls = RXRPC_MAXCALLS - 1; 475 conn->avail_calls = RXRPC_MAXCALLS - 1;
466 ASSERT(conn->channels[0] == NULL && 476 ASSERT(conn->channels[0] == NULL &&
diff --git a/net/rxrpc/ar-connevent.c b/net/rxrpc/ar-connevent.c
index dc5cb1e1950..0505cdc4d6d 100644
--- a/net/rxrpc/ar-connevent.c
+++ b/net/rxrpc/ar-connevent.c
@@ -150,11 +150,15 @@ static int rxrpc_process_event(struct rxrpc_connection *conn,
150 u32 serial; 150 u32 serial;
151 int loop, ret; 151 int loop, ret;
152 152
153 if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) 153 if (conn->state >= RXRPC_CONN_REMOTELY_ABORTED) {
154 kleave(" = -ECONNABORTED [%u]", conn->state);
154 return -ECONNABORTED; 155 return -ECONNABORTED;
156 }
155 157
156 serial = ntohl(sp->hdr.serial); 158 serial = ntohl(sp->hdr.serial);
157 159
160 _enter("{%d},{%u,%%%u},", conn->debug_id, sp->hdr.type, serial);
161
158 switch (sp->hdr.type) { 162 switch (sp->hdr.type) {
159 case RXRPC_PACKET_TYPE_ABORT: 163 case RXRPC_PACKET_TYPE_ABORT:
160 if (skb_copy_bits(skb, 0, &tmp, sizeof(tmp)) < 0) 164 if (skb_copy_bits(skb, 0, &tmp, sizeof(tmp)) < 0)
@@ -199,6 +203,7 @@ static int rxrpc_process_event(struct rxrpc_connection *conn,
199 return 0; 203 return 0;
200 204
201 default: 205 default:
206 _leave(" = -EPROTO [%u]", sp->hdr.type);
202 return -EPROTO; 207 return -EPROTO;
203 } 208 }
204} 209}