Bluetooth: Disconnect the channel if we don't want the proposed mode

If the device is a STATE 2 then it should disconnect the channel if the
remote device propose a mode different from its mandatory mode.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Gustavo F. Padovan 2010-06-08 19:09:48 -03:00 коммит произвёл Marcel Holtmann
Родитель 85eb53c6f7
Коммит 742e519b0d
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -2617,8 +2617,9 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
break; break;
} }
if (!l2cap_mode_supported(pi->mode, pi->conn->feat_mask)) if (pi->mode != rfc.mode)
return -ECONNREFUSED; return -ECONNREFUSED;
break; break;
default: default:
pi->mode = l2cap_select_mode(rfc.mode, pi->conn->feat_mask); pi->mode = l2cap_select_mode(rfc.mode, pi->conn->feat_mask);