Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cb75e1ff
Commit
cb75e1ff
authored
May 08, 2003
by
Maksim Krasnyanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bluetooth] L2CAP config req/rsp fixes.
We have to set continuation flag in config rsp if it was set in req.
parent
5a73a1cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
include/net/bluetooth/l2cap.h
include/net/bluetooth/l2cap.h
+3
-3
net/bluetooth/l2cap.c
net/bluetooth/l2cap.c
+11
-8
No files found.
include/net/bluetooth/l2cap.h
View file @
cb75e1ff
...
...
@@ -231,9 +231,9 @@ struct l2cap_pinfo {
struct
sock
*
prev_c
;
};
#define CONF_REQ_SENT 0x01
#define CONF_INPUT_DONE 0x02
#define CONF_OUTPUT_DONE 0x04
#define
L2CAP_
CONF_REQ_SENT 0x01
#define
L2CAP_
CONF_INPUT_DONE 0x02
#define
L2CAP_
CONF_OUTPUT_DONE 0x04
void
l2cap_load
(
void
);
...
...
net/bluetooth/l2cap.c
View file @
cb75e1ff
...
...
@@ -1313,15 +1313,18 @@ static int l2cap_build_conf_rsp(struct sock *sk, void *data, int *result)
{
struct
l2cap_conf_rsp
*
rsp
=
data
;
void
*
ptr
=
rsp
->
data
;
u16
flags
=
0
;
BT_DBG
(
"sk %p complete %d"
,
sk
,
result
?
1
:
0
);
if
(
result
)
*
result
=
l2cap_conf_output
(
sk
,
&
ptr
);
else
flags
=
0x0001
;
rsp
->
scid
=
__cpu_to_le16
(
l2cap_pi
(
sk
)
->
dcid
);
rsp
->
result
=
__cpu_to_le16
(
result
?
*
result
:
0
);
rsp
->
flags
=
__cpu_to_le16
(
0
);
rsp
->
flags
=
__cpu_to_le16
(
flags
);
return
ptr
-
data
;
}
...
...
@@ -1434,7 +1437,7 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
case
L2CAP_CR_SUCCESS
:
sk
->
state
=
BT_CONFIG
;
l2cap_pi
(
sk
)
->
dcid
=
dcid
;
l2cap_pi
(
sk
)
->
conf_state
|=
CONF_REQ_SENT
;
l2cap_pi
(
sk
)
->
conf_state
|=
L2CAP_
CONF_REQ_SENT
;
l2cap_send_req
(
conn
,
L2CAP_CONF_REQ
,
l2cap_build_conf_req
(
sk
,
req
),
req
);
break
;
...
...
@@ -1469,7 +1472,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
l2cap_parse_conf_req
(
sk
,
req
->
data
,
cmd
->
len
-
sizeof
(
*
req
));
if
(
flags
&
0x01
)
{
if
(
flags
&
0x0
00
1
)
{
/* Incomplete config. Send empty response. */
l2cap_send_rsp
(
conn
,
cmd
->
ident
,
L2CAP_CONF_RSP
,
l2cap_build_conf_rsp
(
sk
,
rsp
,
NULL
),
rsp
);
goto
unlock
;
...
...
@@ -1482,12 +1485,12 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
goto
unlock
;
/* Output config done */
l2cap_pi
(
sk
)
->
conf_state
|=
CONF_OUTPUT_DONE
;
l2cap_pi
(
sk
)
->
conf_state
|=
L2CAP_
CONF_OUTPUT_DONE
;
if
(
l2cap_pi
(
sk
)
->
conf_state
&
CONF_INPUT_DONE
)
{
if
(
l2cap_pi
(
sk
)
->
conf_state
&
L2CAP_
CONF_INPUT_DONE
)
{
sk
->
state
=
BT_CONNECTED
;
l2cap_chan_ready
(
sk
);
}
else
if
(
!
(
l2cap_pi
(
sk
)
->
conf_state
&
CONF_REQ_SENT
))
{
}
else
if
(
!
(
l2cap_pi
(
sk
)
->
conf_state
&
L2CAP_
CONF_REQ_SENT
))
{
u8
req
[
64
];
l2cap_send_req
(
conn
,
L2CAP_CONF_REQ
,
l2cap_build_conf_req
(
sk
,
req
),
req
);
}
...
...
@@ -1532,9 +1535,9 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
goto
done
;
/* Input config done */
l2cap_pi
(
sk
)
->
conf_state
|=
CONF_INPUT_DONE
;
l2cap_pi
(
sk
)
->
conf_state
|=
L2CAP_
CONF_INPUT_DONE
;
if
(
l2cap_pi
(
sk
)
->
conf_state
&
CONF_OUTPUT_DONE
)
{
if
(
l2cap_pi
(
sk
)
->
conf_state
&
L2CAP_
CONF_OUTPUT_DONE
)
{
sk
->
state
=
BT_CONNECTED
;
l2cap_chan_ready
(
sk
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment