diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-19 08:37:53 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-19 08:37:53 -0500 |
commit | 4b0b2f088f12e2ada1297502d7bebde182cf65b0 (patch) | |
tree | c3f5bdb06a047eaca8a2e09b6dfd285d0cc26037 | |
parent | 4dad99928211a20a91ec4515ab3b53fd65988f34 (diff) | |
parent | d7660918fce210f421cc58c060ca3de71e4ffd37 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
Conflicts:
net/bluetooth/l2cap_core.c
-rw-r--r-- | net/bluetooth/hci_conn.c | 2 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 12 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 1 |
3 files changed, 13 insertions, 2 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 385cccbcafe0..401d8ea266aa 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -700,7 +700,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
700 | goto encrypt; | 700 | goto encrypt; |
701 | 701 | ||
702 | auth: | 702 | auth: |
703 | if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) | 703 | if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) |
704 | return 0; | 704 | return 0; |
705 | 705 | ||
706 | if (!hci_conn_auth(conn, sec_level, auth_type)) | 706 | if (!hci_conn_auth(conn, sec_level, auth_type)) |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index ea36d1dea767..ffa2f6b8408f 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -2416,7 +2416,7 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, voi | |||
2416 | void *ptr = req->data; | 2416 | void *ptr = req->data; |
2417 | int type, olen; | 2417 | int type, olen; |
2418 | unsigned long val; | 2418 | unsigned long val; |
2419 | struct l2cap_conf_rfc rfc; | 2419 | struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC }; |
2420 | struct l2cap_conf_efs efs; | 2420 | struct l2cap_conf_efs efs; |
2421 | 2421 | ||
2422 | BT_DBG("chan %p, rsp %p, len %d, req %p", chan, rsp, len, data); | 2422 | 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) | |||
2566 | } | 2566 | } |
2567 | } | 2567 | } |
2568 | 2568 | ||
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 | |||
2569 | done: | 2579 | done: |
2570 | switch (rfc.mode) { | 2580 | switch (rfc.mode) { |
2571 | case L2CAP_MODE_ERTM: | 2581 | case L2CAP_MODE_ERTM: |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 8743f369ed3f..be6288cf854a 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1162,6 +1162,7 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci) | |||
1162 | if (list_empty(&s->dlcs)) { | 1162 | if (list_empty(&s->dlcs)) { |
1163 | s->state = BT_DISCONN; | 1163 | s->state = BT_DISCONN; |
1164 | rfcomm_send_disc(s, 0); | 1164 | rfcomm_send_disc(s, 0); |
1165 | rfcomm_session_clear_timer(s); | ||
1165 | } | 1166 | } |
1166 | 1167 | ||
1167 | break; | 1168 | break; |