Skip to contentSkip to conversation

Pull request: bluetooth-2.6 2009-11-16

PATCH New Marcel Holtmann 2 participants 5 messages Nov 16, 2009

Subsystems (3)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

Hi Dave,

here are three additional patches that should go into 2.6.32 before its final release.

The first one fixes a regression with Secure Simple Pairing support. I had that patch for a while, but it took some time to verify that it doesn't break the Bluetooth qualification. The Bluetooth 2.1 GAP testing is a major pain and always surprises you.

The second and third patches are fixing two regression from the L2CAP ERTM support. When ERTM is not supported or not configured we have to use Basic Mode and really stick to it. Other Bluetooth stacks are not capable of handling unknown options properly.

Regards

Marcel

Please pull from

git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git master

This will update the following files:

 net/bluetooth/hci_conn.c |    1 +
 net/bluetooth/l2cap.c    |   13 +++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

through these ChangeSets:

Andrei Emeltchenko (1):
Bluetooth: Set general bonding security for ACL by default

Gustavo F. Padovan (2):
Bluetooth: Select Basic Mode as default for SOCK_SEQPACKET
Bluetooth: Fix regression with L2CAP configuration in Basic Mode

author maintainer
#1 lore raw

PATCH 1/3 Bluetooth: Set general bonding security for ACL by default

From: Andrei Emeltchenko <[email protected]>

This patch fixes double pairing issues with Secure Simple Paring support. It was observed that when pairing with SSP enabled, that the confirmation will be asked twice.

http://www.spinics.net/lists/linux-bluetooth/msg02473.html

This also causes bug when initiating SSP connection from Windows Vista.

The reason is because bluetoothd does not store link keys since HCIGETAUTHINFO returns 0. Setting default to general bonding fixes these issues.

---
 net/bluetooth/hci_conn.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/bluetooth/hci_conn.c +1 -0
index a975098..b7c4224 100644
@@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
 	conn->type  = type;
 	conn->mode  = HCI_CM_ACTIVE;
 	conn->state = BT_OPEN;
+	conn->auth_type = HCI_AT_GENERAL_BONDING;
 
 	conn->power_save = 1;
 	conn->disc_timeout = HCI_DISCONN_TIMEOUT;
Signature · 1 line
1.6.2.5
author maintainer
#2 lore raw

PATCH 2/3 Bluetooth: Select Basic Mode as default for SOCK_SEQPACKET

From: Gustavo F. Padovan <[email protected]>

The default mode for SOCK_SEQPACKET is Basic Mode. So when no mode has been specified, Basic Mode shall be used.

This is important for current application to keep working as expected and not cause a regression.

---
 net/bluetooth/l2cap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/bluetooth/l2cap.c +1 -1
index 77e9fb1..076caa1 100644
@@ -2205,7 +2205,7 @@ static int l2cap_build_conf_req(struct sock *sk, void *data)
 {
 	struct l2cap_pinfo *pi = l2cap_pi(sk);
 	struct l2cap_conf_req *req = data;
-	struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_ERTM };
+	struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC };
 	void *ptr = req->data;
 
 	BT_DBG("sk %p", sk);
Signature · 1 line
1.6.2.5
author maintainer
#3 lore raw

PATCH 3/3 Bluetooth: Fix regression with L2CAP configuration in Basic Mode

From: Gustavo F. Padovan <[email protected]>

Basic Mode is the default mode of operation of a L2CAP entity. In this case the RFC (Retransmission and Flow Control) configuration option should not be used at all.

Normally remote L2CAP implementation should just ignore this option, but it can cause various side effects with other Bluetooth stacks that are not capable of handling unknown options.

---
 net/bluetooth/l2cap.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
net/bluetooth/l2cap.c +8 -3
index 076caa1..947f8bb 100644
@@ -2394,6 +2394,10 @@ done:
 			rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO;
 
 			pi->conf_state |= L2CAP_CONF_MODE_DONE;
+
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
+					sizeof(rfc), (unsigned long) &rfc);
+
 			break;
 
 		case L2CAP_MODE_STREAMING:
@@ -2401,6 +2405,10 @@ done:
 			pi->max_pdu_size = rfc.max_pdu_size;
 
 			pi->conf_state |= L2CAP_CONF_MODE_DONE;
+
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
+					sizeof(rfc), (unsigned long) &rfc);
+
 			break;
 
 		default:
@@ -2410,9 +2418,6 @@ done:
 			rfc.mode = pi->mode;
 		}
 
-		l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
-					sizeof(rfc), (unsigned long) &rfc);
-
 		if (result == L2CAP_CONF_SUCCESS)
 			pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
 	}
Signature · 1 line
1.6.2.5