From 2fdc1d9134f5dacfbcf0d181065d0666121f4c24 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 14 Jul 2017 14:41:42 +0200 Subject: [PATCH] 6LoWPAN: discard empty packet --- core/net/ipv6/sicslowpan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/net/ipv6/sicslowpan.c b/core/net/ipv6/sicslowpan.c index 95064e8ea..c5ccf91b1 100644 --- a/core/net/ipv6/sicslowpan.c +++ b/core/net/ipv6/sicslowpan.c @@ -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;