Bluetooth: L2CAP: Fix using wrong mode
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 8 Dec 2021 23:35:48 +0000 (15:35 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:53:59 +0000 (10:53 +0100)
commit009bb7ee15779b70726c12ecdac6450bc1a4b47b
tree65509fc6a18f07c4cd4bfdfd84417b287c1213ee
parent1a2241ad400b8d7b8f1a1adef5c5b67829a63934
Bluetooth: L2CAP: Fix using wrong mode

[ Upstream commit 30d57722732d9736554f85f75f9d7ad5402d192e ]

If user has a set to use SOCK_STREAM the socket would default to
L2CAP_MODE_ERTM which later needs to be adjusted if the destination
address is LE which doesn't support such mode.

Fixes: 15f02b9105625 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/l2cap_sock.c