Skip to content

Commit

Permalink
NFC: No need to apply twice the modulo op to LLCP's recv_n
Browse files Browse the repository at this point in the history
recv_n is set properly when receiving an HDLC frame.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Apr 12, 2012
1 parent 4be646e commit 279cf17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/nfc/llcp/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ int nfc_llcp_send_rr(struct nfc_llcp_sock *sock)

skb_put(skb, LLCP_SEQUENCE_SIZE);

skb->data[2] = sock->recv_n % 16;
skb->data[2] = sock->recv_n;

skb_queue_head(&local->tx_queue, skb);

Expand Down
2 changes: 1 addition & 1 deletion net/nfc/llcp/llcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static u8 nfc_llcp_nr(struct sk_buff *pdu)

static void nfc_llcp_set_nrns(struct nfc_llcp_sock *sock, struct sk_buff *pdu)
{
pdu->data[2] = (sock->send_n << 4) | (sock->recv_n % 16);
pdu->data[2] = (sock->send_n << 4) | (sock->recv_n);
sock->send_n = (sock->send_n + 1) % 16;
sock->recv_ack_n = (sock->recv_n - 1) % 16;
}
Expand Down

0 comments on commit 279cf17

Please sign in to comment.