Commit 68ae6639 authored by Gustavo F. Padovan's avatar Gustavo F. Padovan Committed by Marcel Holtmann

Bluetooth: Fix regression with L2CAP configuration in Basic Mode

Basic Mode is the default mode of operation of a L2CAP entity. In
this case the RFC (Retransmission and Flow Control) configuration
option should not be used at all.

Normally remote L2CAP implementation should just ignore this option,
but it can cause various side effects with other Bluetooth stacks
that are not capable of handling unknown options.
Signed-off-by: default avatarGustavo F. Padovan <gustavo@las.ic.unicamp.br>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a0e55a32
...@@ -2394,6 +2394,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data) ...@@ -2394,6 +2394,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO; rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO;
pi->conf_state |= L2CAP_CONF_MODE_DONE; pi->conf_state |= L2CAP_CONF_MODE_DONE;
l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
sizeof(rfc), (unsigned long) &rfc);
break; break;
case L2CAP_MODE_STREAMING: case L2CAP_MODE_STREAMING:
...@@ -2401,6 +2405,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data) ...@@ -2401,6 +2405,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
pi->max_pdu_size = rfc.max_pdu_size; pi->max_pdu_size = rfc.max_pdu_size;
pi->conf_state |= L2CAP_CONF_MODE_DONE; pi->conf_state |= L2CAP_CONF_MODE_DONE;
l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
sizeof(rfc), (unsigned long) &rfc);
break; break;
default: default:
...@@ -2410,9 +2418,6 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data) ...@@ -2410,9 +2418,6 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
rfc.mode = pi->mode; rfc.mode = pi->mode;
} }
l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
sizeof(rfc), (unsigned long) &rfc);
if (result == L2CAP_CONF_SUCCESS) if (result == L2CAP_CONF_SUCCESS)
pi->conf_state |= L2CAP_CONF_OUTPUT_DONE; pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment