Skip to content

Commit

Permalink
Merge branch 'fix/oob_issue_found_by_cid' into 'master'
Browse files Browse the repository at this point in the history
fix(802.15.4): fix oob issue for pending table

Closes IDF-10936, IDF-10937, IDF-10938, IDF-10939, IDF-10940, and IDF-10941

See merge request espressif/esp-idf!33160
  • Loading branch information
zwx1995esp committed Aug 29, 2024
2 parents bb5f95f + 1c319ce commit 7c47596
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/ieee802154/driver/esp_ieee802154_ack.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

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_CLR(mask, pos) (GET_MASK_ITEM_FROM_TABLE(mask, pos) &= ~(1UL << (pos % IEEE802154_PENDING_TABLE_MASK_BITS)))
Expand Down
2 changes: 1 addition & 1 deletion components/ieee802154/private_include/esp_ieee802154_ack.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
*/

#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 {
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 */
Expand Down

0 comments on commit 7c47596

Please sign in to comment.