Skip to content

Commit

Permalink
Bluetooth: Refuse ConfigRsp with different mode
Browse files Browse the repository at this point in the history
If our mode is Basic Mode we have to refuse any ConfigRsp that proposes
a different mode.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Gustavo F. Padovan authored and Marcel Holtmann committed Jul 21, 2010
1 parent 6254775 commit 6c2ea7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,6 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data,
rfc.mode != pi->mode)
return -ECONNREFUSED;

pi->mode = rfc.mode;
pi->fcs = 0;

l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
Expand All @@ -2756,6 +2755,11 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data,
}
}

if (pi->mode == L2CAP_MODE_BASIC && pi->mode != rfc.mode)
return -ECONNREFUSED;

pi->mode = rfc.mode;

if (*result == L2CAP_CONF_SUCCESS) {
switch (rfc.mode) {
case L2CAP_MODE_ERTM:
Expand Down

0 comments on commit 6c2ea7a

Please sign in to comment.