mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-19 08:20:00 +00:00
nimble/gatts: Add check for RFU bits
This commit is contained in:
@@ -120,6 +120,7 @@ struct os_mbuf;
|
||||
*/
|
||||
|
||||
/** Error Response. */
|
||||
|
||||
#define BLE_ATT_OP_ERROR_RSP 0x01
|
||||
|
||||
/** MTU Request. */
|
||||
|
||||
@@ -89,6 +89,11 @@ extern STATS_SECT_DECL(ble_gatts_stats) ble_gatts_stats;
|
||||
#define BLE_GATT_CHR_DECL_SZ_16 5
|
||||
#define BLE_GATT_CHR_DECL_SZ_128 19
|
||||
#define BLE_GATT_CHR_CLI_SUP_FEAT_SZ 1
|
||||
/**
|
||||
* For now only 3 bits in first octet are defined
|
||||
*
|
||||
*/
|
||||
#define BLE_GATT_CHR_CLI_SUP_FEAT_MASK 7
|
||||
|
||||
typedef uint8_t ble_gatts_conn_flags;
|
||||
|
||||
|
||||
@@ -2050,12 +2050,11 @@ ble_gatts_peer_cl_sup_feat_update(uint16_t conn_handle, struct os_mbuf *om)
|
||||
uint16_t len;
|
||||
int rc = 0;
|
||||
int i;
|
||||
int rfu_mask = 7;
|
||||
|
||||
BLE_HS_LOG(DEBUG, "");
|
||||
|
||||
if (!om) {
|
||||
return BLE_HS_EINVAL;
|
||||
return BLE_ATT_ERR_INSUFFICIENT_RES;
|
||||
}
|
||||
|
||||
/* RFU bits are ignored so we can skip any bytes larger than supported */
|
||||
@@ -2076,7 +2075,7 @@ ble_gatts_peer_cl_sup_feat_update(uint16_t conn_handle, struct os_mbuf *om)
|
||||
ble_hs_lock();
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
if (conn == NULL) {
|
||||
rc = BLE_HS_ENOTCONN;
|
||||
rc = BLE_ATT_ERR_UNLIKELY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user