diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-01-24 03:35:41 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-13 02:51:37 -0500 |
commit | 21626e6214f92aaae580052c760dc85f83b5faef (patch) | |
tree | 425df2304948783f3794331c313b7086d9933344 /net/bluetooth/l2cap_sock.c | |
parent | 2338a7e0440d646c194d421748ea36665e648384 (diff) |
Bluetooth: Switch ATT channels to use L2CAP_CHAN_FIXED
ATT channels are not connection oriented so having them use
L2CAP_CHAN_CONN_ORIENTED is quite confusing. Instead, use the new
L2CAP_CHAN_FIXED type and ensure that the MTU and CID values get
properly set.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index fe086b4efc0c..04abd26a3466 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -101,6 +101,15 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) | |||
101 | if (!bdaddr_type_is_valid(la.l2_bdaddr_type)) | 101 | if (!bdaddr_type_is_valid(la.l2_bdaddr_type)) |
102 | return -EINVAL; | 102 | return -EINVAL; |
103 | 103 | ||
104 | if (la.l2_cid) { | ||
105 | /* When the socket gets created it defaults to | ||
106 | * CHAN_CONN_ORIENTED, so we need to overwrite the | ||
107 | * default here. | ||
108 | */ | ||
109 | chan->chan_type = L2CAP_CHAN_FIXED; | ||
110 | chan->omtu = L2CAP_DEFAULT_MTU; | ||
111 | } | ||
112 | |||
104 | if (bdaddr_type_is_le(la.l2_bdaddr_type)) { | 113 | if (bdaddr_type_is_le(la.l2_bdaddr_type)) { |
105 | if (!enable_lecoc && la.l2_psm) | 114 | if (!enable_lecoc && la.l2_psm) |
106 | return -EINVAL; | 115 | return -EINVAL; |