diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 9ab01999149..4c5071373f4 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -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;