diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 78ab8811e5ef..73bda0ae41d6 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -3362,6 +3362,16 @@ expected: | |||
3362 | return 0; | 3362 | return 0; |
3363 | } | 3363 | } |
3364 | 3364 | ||
3365 | if (rx_control & L2CAP_CTRL_FINAL) { | ||
3366 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) | ||
3367 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; | ||
3368 | else { | ||
3369 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3370 | pi->next_tx_seq = pi->expected_ack_seq; | ||
3371 | l2cap_ertm_send(sk); | ||
3372 | } | ||
3373 | } | ||
3374 | |||
3365 | pi->buffer_seq = (pi->buffer_seq + 1) % 64; | 3375 | pi->buffer_seq = (pi->buffer_seq + 1) % 64; |
3366 | 3376 | ||
3367 | err = l2cap_sar_reassembly_sdu(sk, skb, rx_control); | 3377 | err = l2cap_sar_reassembly_sdu(sk, skb, rx_control); |
@@ -3398,6 +3408,14 @@ static inline int l2cap_data_channel_sframe(struct sock *sk, u16 rx_control, str | |||
3398 | pi->expected_ack_seq = tx_seq; | 3408 | pi->expected_ack_seq = tx_seq; |
3399 | l2cap_drop_acked_frames(sk); | 3409 | l2cap_drop_acked_frames(sk); |
3400 | 3410 | ||
3411 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) | ||
3412 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; | ||
3413 | else { | ||
3414 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3415 | pi->next_tx_seq = pi->expected_ack_seq; | ||
3416 | l2cap_ertm_send(sk); | ||
3417 | } | ||
3418 | |||
3401 | if (!(pi->conn_state & L2CAP_CONN_WAIT_F)) | 3419 | if (!(pi->conn_state & L2CAP_CONN_WAIT_F)) |
3402 | break; | 3420 | break; |
3403 | 3421 | ||
@@ -3425,10 +3443,24 @@ static inline int l2cap_data_channel_sframe(struct sock *sk, u16 rx_control, str | |||
3425 | pi->expected_ack_seq = __get_reqseq(rx_control); | 3443 | pi->expected_ack_seq = __get_reqseq(rx_control); |
3426 | l2cap_drop_acked_frames(sk); | 3444 | l2cap_drop_acked_frames(sk); |
3427 | 3445 | ||
3428 | sk->sk_send_head = TX_QUEUE(sk)->next; | 3446 | if (rx_control & L2CAP_CTRL_FINAL) { |
3429 | pi->next_tx_seq = pi->expected_ack_seq; | 3447 | if (pi->conn_state & L2CAP_CONN_REJ_ACT) |
3448 | pi->conn_state &= ~L2CAP_CONN_REJ_ACT; | ||
3449 | else { | ||
3450 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3451 | pi->next_tx_seq = pi->expected_ack_seq; | ||
3452 | l2cap_ertm_send(sk); | ||
3453 | } | ||
3454 | } else { | ||
3455 | sk->sk_send_head = TX_QUEUE(sk)->next; | ||
3456 | pi->next_tx_seq = pi->expected_ack_seq; | ||
3457 | l2cap_ertm_send(sk); | ||
3430 | 3458 | ||
3431 | l2cap_ertm_send(sk); | 3459 | if (pi->conn_state & L2CAP_CONN_WAIT_F) { |
3460 | pi->srej_save_reqseq = tx_seq; | ||
3461 | pi->conn_state |= L2CAP_CONN_REJ_ACT; | ||
3462 | } | ||
3463 | } | ||
3432 | 3464 | ||
3433 | break; | 3465 | break; |
3434 | 3466 | ||