Bluetooth: ATT: Fix write check permission

Writes to GATT attribute that has no write permission set, should
return write not permitted (BT_ATT_ERR_WRITE_NOT_PERMITTED)
in check permission routine.

Change-Id: I95f0988e171294cd98b79d3e7b518383ac47567d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This commit is contained in:
Arkadiusz Lichwa 2015-09-15 11:21:44 +02:00 committed by Anas Nashif
commit 348276044f

View file

@ -634,7 +634,7 @@ static uint8_t check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr,
} }
if ((mask & BT_GATT_PERM_WRITE) && !(attr->perm & BT_GATT_PERM_WRITE)) { if ((mask & BT_GATT_PERM_WRITE) && !(attr->perm & BT_GATT_PERM_WRITE)) {
return BT_ATT_ERR_READ_NOT_PERMITTED; return BT_ATT_ERR_WRITE_NOT_PERMITTED;
} }
mask &= attr->perm; mask &= attr->perm;