Skip to content

Commit 4b0b2f0

Browse files
author
Gustavo F. Padovan
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
Conflicts: net/bluetooth/l2cap_core.c
2 parents 4dad999 + d766091 commit 4b0b2f0

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎net/bluetooth/hci_conn.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
700700
goto encrypt;
701701

702702
auth:
703-
if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
703+
if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
704704
return 0;
705705

706706
if (!hci_conn_auth(conn, sec_level, auth_type))

‎net/bluetooth/l2cap_core.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, voi
24162416
void *ptr = req->data;
24172417
int type, olen;
24182418
unsigned long val;
2419-
struct l2cap_conf_rfc rfc;
2419+
struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC };
24202420
struct l2cap_conf_efs efs;
24212421

24222422
BT_DBG("chan %p, rsp %p, len %d, req %p", chan, rsp, len, data);
@@ -2566,6 +2566,16 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
25662566
}
25672567
}
25682568

2569+
/* Use sane default values in case a misbehaving remote device
2570+
* did not send an RFC option.
2571+
*/
2572+
rfc.mode = chan->mode;
2573+
rfc.retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO);
2574+
rfc.monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO);
2575+
rfc.max_pdu_size = cpu_to_le16(chan->imtu);
2576+
2577+
BT_ERR("Expected RFC option was not found, using defaults");
2578+
25692579
done:
25702580
switch (rfc.mode) {
25712581
case L2CAP_MODE_ERTM:

‎net/bluetooth/rfcomm/core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,7 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
11621162
if (list_empty(&s->dlcs)) {
11631163
s->state = BT_DISCONN;
11641164
rfcomm_send_disc(s, 0);
1165+
rfcomm_session_clear_timer(s);
11651166
}
11661167

11671168
break;

0 commit comments

Comments
 (0)