Skip to content

Commit

Permalink
[IEEE802.15.4] - headroom fix of memory corruption
Browse files Browse the repository at this point in the history
  • Loading branch information
jelledevleeschouwer committed Feb 3, 2017
1 parent 976b90c commit beca16b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/pico_802154.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ addr_802154_iid(uint8_t iid[8], union pico_ll_addr *addr)
static struct pico_frame *
pico_frame_alloc_with_headroom(uint16_t size, uint16_t headroom, uint16_t overhead)
{
int network_offset = (((headroom + overhead) >> 3) + 1) << 3; // Sufficient headroom for alignment
struct pico_frame *f = pico_frame_alloc((uint32_t)(size + headroom + overhead));
int network_offset = (((headroom + overhead) >> 2) + 1) << 2; // Sufficient headroom for alignment
struct pico_frame *f = pico_frame_alloc((uint32_t)(size + network_offset));

if (!f)
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions modules/pico_dev_radiotest.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ struct pico_device *pico_radiotest_create(uint8_t addr, uint8_t area0, uint8_t a
}

if (dump) {
// dbg("Dump: %s\n", dump);
// radiotest_pcap_open(radio, dump);
dbg("Dump: %s\n", dump);
radiotest_pcap_open(radio, dump);
}

return (struct pico_device *)lp;
Expand Down

0 comments on commit beca16b

Please sign in to comment.