Skip to content

Commit

Permalink
[Bluetooth]: Don't update disconnect timer for incoming connections
Browse files Browse the repository at this point in the history
In the case of device pairing the only safe method is to establish
a low-level ACL link. In this case, the remote side should not use
the disconnect timer to give the other side the chance to enter the
PIN code. If the disconnect timer is used, the connection will be
dropped to soon, because it is impossible to identify an actual user
of this link.

Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
holtmann authored and David S. Miller committed Sep 29, 2006
1 parent 75f3123 commit 37e97b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,6 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
if (test_bit(HCI_ENCRYPT, &hdev->flags))
conn->link_mode |= HCI_LM_ENCRYPT;

hci_conn_hold(conn);

/* Get remote features */
if (conn->type == ACL_LINK) {
struct hci_cp_read_remote_features cp;
Expand Down Expand Up @@ -779,9 +777,11 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s

hci_send_cmd(hdev, OGF_LINK_CTL,
OCF_CHANGE_CONN_PTYPE, sizeof(cp), &cp);
} else {
/* Update disconnect timer */
hci_conn_hold(conn);
hci_conn_put(conn);
}

hci_conn_put(conn);
} else
conn->state = BT_CLOSED;

Expand Down

0 comments on commit 37e97b4

Please sign in to comment.