From e4f78a523a521905a1fd8617deb2a97b391d7793 Mon Sep 17 00:00:00 2001 From: idgay Date: Fri, 25 Jul 2008 16:27:52 +0000 Subject: [PATCH] proper fix for short packets --- tos/chips/cc2420/receive/CC2420ReceiveP.nc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tos/chips/cc2420/receive/CC2420ReceiveP.nc b/tos/chips/cc2420/receive/CC2420ReceiveP.nc index 710d0d7e..30a42191 100644 --- a/tos/chips/cc2420/receive/CC2420ReceiveP.nc +++ b/tos/chips/cc2420/receive/CC2420ReceiveP.nc @@ -214,7 +214,7 @@ implementation { if(rxFrameLength <= MAC_PACKET_SIZE) { if(rxFrameLength > 0) { - if(rxFrameLength >= CC2420_SIZE) { + if(rxFrameLength > SACK_HEADER_LENGTH) { // This packet has an FCF byte plus at least one more byte to read call RXFIFO.continueRead(buf + 1, SACK_HEADER_LENGTH); @@ -334,7 +334,7 @@ implementation { metadata->lqi = buf[ length ] & 0x7f; metadata->rssi = buf[ length - 1 ]; - if(passesAddressCheck(m_p_rx_buf)) { + if (passesAddressCheck(m_p_rx_buf) && length >= CC2420_SIZE) { m_p_rx_buf = signal Receive.receive( m_p_rx_buf, m_p_rx_buf->data, length - CC2420_SIZE); } -- 2.39.2