diff options
-rw-r--r-- | net/nfc/llcp/llcp.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index 8510a2fb3da8..bbfaa2750ea8 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c | |||
@@ -671,15 +671,15 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, | |||
671 | nfc_llcp_sock_put(llcp_sock); | 671 | nfc_llcp_sock_put(llcp_sock); |
672 | } | 672 | } |
673 | 673 | ||
674 | if (ns == llcp_sock->recv_n) | ||
675 | llcp_sock->recv_n = (llcp_sock->recv_n + 1) % 16; | ||
676 | else | ||
677 | pr_err("Received out of sequence I PDU\n"); | ||
678 | |||
679 | /* Pass the payload upstream */ | 674 | /* Pass the payload upstream */ |
680 | if (ptype == LLCP_PDU_I) { | 675 | if (ptype == LLCP_PDU_I) { |
681 | pr_debug("I frame, queueing on %p\n", &llcp_sock->sk); | 676 | pr_debug("I frame, queueing on %p\n", &llcp_sock->sk); |
682 | 677 | ||
678 | if (ns == llcp_sock->recv_n) | ||
679 | llcp_sock->recv_n = (llcp_sock->recv_n + 1) % 16; | ||
680 | else | ||
681 | pr_err("Received out of sequence I PDU\n"); | ||
682 | |||
683 | skb_pull(skb, LLCP_HEADER_SIZE + LLCP_SEQUENCE_SIZE); | 683 | skb_pull(skb, LLCP_HEADER_SIZE + LLCP_SEQUENCE_SIZE); |
684 | if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) { | 684 | if (sock_queue_rcv_skb(&llcp_sock->sk, skb)) { |
685 | pr_err("receive queue is full\n"); | 685 | pr_err("receive queue is full\n"); |
@@ -700,6 +700,11 @@ static void nfc_llcp_recv_hdlc(struct nfc_llcp_local *local, | |||
700 | } | 700 | } |
701 | } | 701 | } |
702 | 702 | ||
703 | if (ptype == LLCP_PDU_RR) | ||
704 | llcp_sock->remote_ready = true; | ||
705 | else if (ptype == LLCP_PDU_RNR) | ||
706 | llcp_sock->remote_ready = false; | ||
707 | |||
703 | nfc_llcp_queue_i_frames(llcp_sock); | 708 | nfc_llcp_queue_i_frames(llcp_sock); |
704 | 709 | ||
705 | release_sock(sk); | 710 | release_sock(sk); |
@@ -813,6 +818,7 @@ static void nfc_llcp_rx_work(struct work_struct *work) | |||
813 | 818 | ||
814 | case LLCP_PDU_I: | 819 | case LLCP_PDU_I: |
815 | case LLCP_PDU_RR: | 820 | case LLCP_PDU_RR: |
821 | case LLCP_PDU_RNR: | ||
816 | pr_debug("I frame\n"); | 822 | pr_debug("I frame\n"); |
817 | nfc_llcp_recv_hdlc(local, skb); | 823 | nfc_llcp_recv_hdlc(local, skb); |
818 | break; | 824 | break; |