Bluetooth: Use correct endianness in L2CAP configuration fallback
Default RFC values should use le16 byte ordering. These values are used only as a fallback when poorly-behaved remote devices do not send a proper RFC option in an ERTM or streaming configuration response. Change-Id: I51c9ae892f18229f568b354c92b64e3a8054b619 Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
This commit is contained in:
@@ -3749,9 +3749,9 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data,
|
||||
|
||||
/* Initialize rfc in case no rfc option is received */
|
||||
rfc.mode = pi->mode;
|
||||
rfc.retrans_timeout = L2CAP_DEFAULT_RETRANS_TO;
|
||||
rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO;
|
||||
rfc.max_pdu_size = L2CAP_DEFAULT_MAX_PDU_SIZE;
|
||||
rfc.retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO);
|
||||
rfc.monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO);
|
||||
rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE);
|
||||
|
||||
while (len >= L2CAP_CONF_OPT_SIZE) {
|
||||
len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
|
||||
@@ -3849,9 +3849,9 @@ static void l2cap_conf_rfc_get(struct sock *sk, void *rsp, int len)
|
||||
|
||||
/* Initialize rfc in case no rfc option is received */
|
||||
rfc.mode = pi->mode;
|
||||
rfc.retrans_timeout = L2CAP_DEFAULT_RETRANS_TO;
|
||||
rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO;
|
||||
rfc.max_pdu_size = L2CAP_DEFAULT_MAX_PDU_SIZE;
|
||||
rfc.retrans_timeout = cpu_to_le16(L2CAP_DEFAULT_RETRANS_TO);
|
||||
rfc.monitor_timeout = cpu_to_le16(L2CAP_DEFAULT_MONITOR_TO);
|
||||
rfc.max_pdu_size = cpu_to_le16(L2CAP_DEFAULT_MAX_PDU_SIZE);
|
||||
|
||||
if ((pi->mode != L2CAP_MODE_ERTM) && (pi->mode != L2CAP_MODE_STREAMING))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user