OSDN Git Service

Bluetooth: Fix RFCOMM NSC response
authorSzymon Janc <szymon.janc@tieto.com>
Mon, 13 Oct 2014 09:43:53 +0000 (11:43 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 25 Oct 2014 05:56:24 +0000 (07:56 +0200)
commitec511545ef791577ed9dd055e3b2d6d926b85daf
treec579a73d0960f8b0d45f72a75a0ce9957265799b
parent89cbb0638e9b7ba6fab02558f47a29f144df1a19
Bluetooth: Fix RFCOMM NSC response

rfcomm_send_nsc expects CR to be either 0 or 1 since it is later
passed to __mcc_type macro and shitfed. Unfortunatelly CR extracted
from received frame type was not sanitized and shifted value was passed
resulting in bogus response.

Note: shifted value was also passed to other functions but was used
only in if satements so this bug appears only for NSC case.

The CR bit in the value octet shall be set to the same value
as the CR bit in the type field octet of the not supported command
frame but the CR bit for NCS response should be set to 0 since it is
always a response.

This was affecting TC_RFC_BV_25_C PTS qualification test.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/rfcomm/core.c