From beca16bdfc9e9e92e06d59647afeb62537f31c04 Mon Sep 17 00:00:00 2001 From: jelledevleeschouwer Date: Fri, 3 Feb 2017 15:33:42 +0100 Subject: [PATCH] [IEEE802.15.4] - headroom fix of memory corruption --- modules/pico_802154.c | 4 ++-- modules/pico_dev_radiotest.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/pico_802154.c b/modules/pico_802154.c index 4a405bdaa..c65f1e427 100644 --- a/modules/pico_802154.c +++ b/modules/pico_802154.c @@ -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; diff --git a/modules/pico_dev_radiotest.c b/modules/pico_dev_radiotest.c index 14d747180..6f8c701e5 100644 --- a/modules/pico_dev_radiotest.c +++ b/modules/pico_dev_radiotest.c @@ -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;