Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions drivers/ieee802154/ieee802154_nrf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ static void nrf5_rx_thread(void *arg1, void *arg2, void *arg3)
}

#if defined(CONFIG_NET_BUF_DATA_SIZE)
__ASSERT_NO_MSG(pkt_len <= CONFIG_NET_BUF_DATA_SIZE);
if (pkt_len > CONFIG_NET_BUF_DATA_SIZE) {
LOG_ERR("Received a frame exceeding the buffer size (%u): %u",
CONFIG_NET_BUF_DATA_SIZE, pkt_len);
LOG_HEXDUMP_ERR(rx_frame->psdu, rx_frame->psdu[0] + 1, "Received PSDU");
goto drop;
}
#endif

LOG_DBG("Frame received");
Expand Down Expand Up @@ -232,7 +237,9 @@ static void nrf5_rx_thread(void *arg1, void *arg2, void *arg3)
rx_frame->psdu = NULL;
nrf_802154_buffer_free_raw(psdu);

net_pkt_unref(pkt);
if (pkt) {
net_pkt_unref(pkt);
}
}
}

Expand Down Expand Up @@ -1114,8 +1121,12 @@ void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi,
nrf5_data.rx_frames[i].lqi = lqi;

#if defined(CONFIG_NET_PKT_TIMESTAMP)
nrf5_data.rx_frames[i].time =
nrf_802154_timestamp_end_to_phr_convert(time, data[0]);
if (time != NRF_802154_NO_TIMESTAMP) {
nrf5_data.rx_frames[i].time =
nrf_802154_timestamp_end_to_phr_convert(time, data[0]);
} else {
nrf5_data.rx_frames[i].time = 0;
}
#endif

nrf5_data.rx_frames[i].ack_fpb = nrf5_data.last_frame_ack_fpb;
Expand Down