]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Bluetooth: Fix channel check when binding RFCOMM sock
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Thu, 20 Feb 2014 15:42:01 +0000 (16:42 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 20 Feb 2014 19:34:08 +0000 (11:34 -0800)
commitb1765e7afe8710ef4366dc722cc5bd487eb07973
treefcd3beef085776f49ae6de30564444ac18e5eb95
parent7a4cd51dec96b42d899ed7b2207c9ef810534451
Bluetooth: Fix channel check when binding RFCOMM sock

When binding RFCOMM socket with non-zero channel we're checking if
there is already any other socket which has the same channel number
assigned and then fail. This check does not consider situation where
we have another socket connected to remote device on given channel
number in which case we still should be able to bind local socket.

This patch changes __rfcomm_get_sock_by_addr() to return only sockets
in either BT_BOUND or BT_LISTEN states, also name is updated to better
describe what this function does now.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/rfcomm/sock.c