@@ -263,13 +263,11 @@ struct rxrpc_security {
263
263
264
264
/* respond to a challenge */
265
265
int (* respond_to_challenge )(struct rxrpc_connection * ,
266
- struct sk_buff * ,
267
- u32 * );
266
+ struct sk_buff * );
268
267
269
268
/* verify a response */
270
269
int (* verify_response )(struct rxrpc_connection * ,
271
- struct sk_buff * ,
272
- u32 * );
270
+ struct sk_buff * );
273
271
274
272
/* clear connection security */
275
273
void (* clear )(struct rxrpc_connection * );
@@ -367,6 +365,18 @@ struct rxrpc_conn_parameters {
367
365
u32 security_level ; /* Security level selected */
368
366
};
369
367
368
+ /*
369
+ * Call completion condition (state == RXRPC_CALL_COMPLETE).
370
+ */
371
+ enum rxrpc_call_completion {
372
+ RXRPC_CALL_SUCCEEDED , /* - Normal termination */
373
+ RXRPC_CALL_REMOTELY_ABORTED , /* - call aborted by peer */
374
+ RXRPC_CALL_LOCALLY_ABORTED , /* - call aborted locally on error or close */
375
+ RXRPC_CALL_LOCAL_ERROR , /* - call failed due to local error */
376
+ RXRPC_CALL_NETWORK_ERROR , /* - call terminated by network error */
377
+ NR__RXRPC_CALL_COMPLETIONS
378
+ };
379
+
370
380
/*
371
381
* Bits in the connection flags.
372
382
*/
@@ -391,6 +401,7 @@ enum rxrpc_conn_flag {
391
401
*/
392
402
enum rxrpc_conn_event {
393
403
RXRPC_CONN_EV_CHALLENGE , /* Send challenge packet */
404
+ RXRPC_CONN_EV_ABORT_CALLS , /* Abort attached calls */
394
405
};
395
406
396
407
/*
@@ -403,8 +414,7 @@ enum rxrpc_conn_proto_state {
403
414
RXRPC_CONN_SERVICE_UNSECURED , /* Service unsecured connection */
404
415
RXRPC_CONN_SERVICE_CHALLENGING , /* Service challenging for security */
405
416
RXRPC_CONN_SERVICE , /* Service secured connection */
406
- RXRPC_CONN_REMOTELY_ABORTED , /* Conn aborted by peer */
407
- RXRPC_CONN_LOCALLY_ABORTED , /* Conn aborted locally */
417
+ RXRPC_CONN_ABORTED , /* Conn aborted */
408
418
RXRPC_CONN__NR_STATES
409
419
};
410
420
@@ -487,7 +497,8 @@ struct rxrpc_connection {
487
497
unsigned long idle_timestamp ; /* Time at which last became idle */
488
498
spinlock_t state_lock ; /* state-change lock */
489
499
enum rxrpc_conn_proto_state state ; /* current state of connection */
490
- u32 abort_code ; /* Abort code of connection abort */
500
+ enum rxrpc_call_completion completion ; /* Completion condition */
501
+ s32 abort_code ; /* Abort code of connection abort */
491
502
int debug_id ; /* debug ID for printks */
492
503
atomic_t serial ; /* packet serial number counter */
493
504
unsigned int hi_serial ; /* highest serial number received */
@@ -561,18 +572,6 @@ enum rxrpc_call_state {
561
572
NR__RXRPC_CALL_STATES
562
573
};
563
574
564
- /*
565
- * Call completion condition (state == RXRPC_CALL_COMPLETE).
566
- */
567
- enum rxrpc_call_completion {
568
- RXRPC_CALL_SUCCEEDED , /* - Normal termination */
569
- RXRPC_CALL_REMOTELY_ABORTED , /* - call aborted by peer */
570
- RXRPC_CALL_LOCALLY_ABORTED , /* - call aborted locally on error or close */
571
- RXRPC_CALL_LOCAL_ERROR , /* - call failed due to local error */
572
- RXRPC_CALL_NETWORK_ERROR , /* - call terminated by network error */
573
- NR__RXRPC_CALL_COMPLETIONS
574
- };
575
-
576
575
/*
577
576
* Call Tx congestion management modes.
578
577
*/
@@ -905,11 +904,19 @@ void rxrpc_clean_up_local_conns(struct rxrpc_local *);
905
904
*/
906
905
void rxrpc_conn_retransmit_call (struct rxrpc_connection * conn , struct sk_buff * skb ,
907
906
unsigned int channel );
907
+ int rxrpc_abort_conn (struct rxrpc_connection * conn , struct sk_buff * skb ,
908
+ s32 abort_code , int err , const char * why );
908
909
void rxrpc_process_connection (struct work_struct * );
909
910
void rxrpc_process_delayed_final_acks (struct rxrpc_connection * , bool );
910
911
int rxrpc_input_conn_packet (struct rxrpc_connection * conn , struct sk_buff * skb );
911
912
void rxrpc_input_conn_event (struct rxrpc_connection * conn , struct sk_buff * skb );
912
913
914
+ static inline bool rxrpc_is_conn_aborted (const struct rxrpc_connection * conn )
915
+ {
916
+ /* Order reading the abort info after the state check. */
917
+ return smp_load_acquire (& conn -> state ) == RXRPC_CONN_ABORTED ;
918
+ }
919
+
913
920
/*
914
921
* conn_object.c
915
922
*/
@@ -1059,6 +1066,7 @@ static inline struct rxrpc_net *rxrpc_net(struct net *net)
1059
1066
int rxrpc_send_ack_packet (struct rxrpc_call * call , struct rxrpc_txbuf * txb );
1060
1067
int rxrpc_send_abort_packet (struct rxrpc_call * );
1061
1068
int rxrpc_send_data_packet (struct rxrpc_call * , struct rxrpc_txbuf * );
1069
+ void rxrpc_send_conn_abort (struct rxrpc_connection * conn );
1062
1070
void rxrpc_reject_packet (struct rxrpc_local * local , struct sk_buff * skb );
1063
1071
void rxrpc_send_keepalive (struct rxrpc_peer * );
1064
1072
void rxrpc_transmit_one (struct rxrpc_call * call , struct rxrpc_txbuf * txb );
0 commit comments