diff options
Diffstat (limited to 'net/bluetooth/l2cap.c')
-rw-r--r-- | net/bluetooth/l2cap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index ca9bab225777..c5904082392c 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2747,7 +2747,6 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data, | |||
2747 | rfc.mode != pi->mode) | 2747 | rfc.mode != pi->mode) |
2748 | return -ECONNREFUSED; | 2748 | return -ECONNREFUSED; |
2749 | 2749 | ||
2750 | pi->mode = rfc.mode; | ||
2751 | pi->fcs = 0; | 2750 | pi->fcs = 0; |
2752 | 2751 | ||
2753 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, | 2752 | l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, |
@@ -2756,6 +2755,11 @@ static int l2cap_parse_conf_rsp(struct sock *sk, void *rsp, int len, void *data, | |||
2756 | } | 2755 | } |
2757 | } | 2756 | } |
2758 | 2757 | ||
2758 | if (pi->mode == L2CAP_MODE_BASIC && pi->mode != rfc.mode) | ||
2759 | return -ECONNREFUSED; | ||
2760 | |||
2761 | pi->mode = rfc.mode; | ||
2762 | |||
2759 | if (*result == L2CAP_CONF_SUCCESS) { | 2763 | if (*result == L2CAP_CONF_SUCCESS) { |
2760 | switch (rfc.mode) { | 2764 | switch (rfc.mode) { |
2761 | case L2CAP_MODE_ERTM: | 2765 | case L2CAP_MODE_ERTM: |