mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(802.15.4): fix oob issue for pending table
This commit is contained in:
parent
99b89b726d
commit
1c319ce9c2
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
static ieee802154_pending_table_t ieee802154_pending_table;
|
static ieee802154_pending_table_t ieee802154_pending_table;
|
||||||
|
|
||||||
#define GET_MASK_ITEM_FROM_TABLE(mask, pos) (mask[(pos + 1) / IEEE802154_PENDING_TABLE_MASK_BITS])
|
#define GET_MASK_ITEM_FROM_TABLE(mask, pos) (mask[(pos) / IEEE802154_PENDING_TABLE_MASK_BITS])
|
||||||
|
|
||||||
#define BIT_SET(mask, pos) (GET_MASK_ITEM_FROM_TABLE(mask, pos) |= (1UL << (pos % IEEE802154_PENDING_TABLE_MASK_BITS)))
|
#define BIT_SET(mask, pos) (GET_MASK_ITEM_FROM_TABLE(mask, pos) |= (1UL << (pos % IEEE802154_PENDING_TABLE_MASK_BITS)))
|
||||||
#define BIT_CLR(mask, pos) (GET_MASK_ITEM_FROM_TABLE(mask, pos) &= ~(1UL << (pos % IEEE802154_PENDING_TABLE_MASK_BITS)))
|
#define BIT_CLR(mask, pos) (GET_MASK_ITEM_FROM_TABLE(mask, pos) &= ~(1UL << (pos % IEEE802154_PENDING_TABLE_MASK_BITS)))
|
||||||
|
@ -21,7 +21,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define IEEE802154_PENDING_TABLE_MASK_BITS (8)
|
#define IEEE802154_PENDING_TABLE_MASK_BITS (8)
|
||||||
#define IEEE802154_PENDING_TABLE_MASK_SIZE ((CONFIG_IEEE802154_PENDING_TABLE_SIZE + 1) / IEEE802154_PENDING_TABLE_MASK_BITS)
|
#define IEEE802154_PENDING_TABLE_MASK_SIZE (((CONFIG_IEEE802154_PENDING_TABLE_SIZE - 1) / IEEE802154_PENDING_TABLE_MASK_BITS) + 1)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t short_addr[CONFIG_IEEE802154_PENDING_TABLE_SIZE][IEEE802154_FRAME_SHORT_ADDR_SIZE]; /*!< Short address table */
|
uint8_t short_addr[CONFIG_IEEE802154_PENDING_TABLE_SIZE][IEEE802154_FRAME_SHORT_ADDR_SIZE]; /*!< Short address table */
|
||||||
uint8_t ext_addr[CONFIG_IEEE802154_PENDING_TABLE_SIZE][IEEE802154_FRAME_EXT_ADDR_SIZE]; /*!< Extend address table */
|
uint8_t ext_addr[CONFIG_IEEE802154_PENDING_TABLE_SIZE][IEEE802154_FRAME_EXT_ADDR_SIZE]; /*!< Extend address table */
|
||||||
|
Loading…
Reference in New Issue
Block a user