6LoWPAN: discard empty packet

This commit is contained in:
Simon Duquennoy 2017-07-14 14:41:42 +02:00
parent a223022a74
commit 2fdc1d9134
1 changed files with 5 additions and 0 deletions

View File

@ -1726,6 +1726,11 @@ input(void)
/* The MAC puts the 15.4 payload inside the packetbuf data buffer */
packetbuf_ptr = packetbuf_dataptr();
if(packetbuf_datalen() == 0) {
LOG_WARN("empty packet\n");
return;
}
/* This is default uip_buf since we assume that this is not fragmented */
buffer = (uint8_t *)UIP_IP_BUF;