From cd14f65ebe400dd7bb116019bb58892ba83d3f60 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 5 Feb 2016 16:23:57 +0200 Subject: [PATCH] net: Initialize Contiki vars related to L2 buffer mgmt The l2_buf struct contains variables that Contiki uses for it's state management. It is important that we initialize these variables into sane values otherwise there will be hard to catch errors like overwriting memory in other parts of the system. Change-Id: Id0f552a6f0f2858fc6e8e4964ada0715a40f46f8 Signed-off-by: Jukka Rissanen --- net/ip/l2_buf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ip/l2_buf.c b/net/ip/l2_buf.c index 4a4456b388b..ced16a0f8c5 100644 --- a/net/ip/l2_buf.c +++ b/net/ip/l2_buf.c @@ -125,6 +125,8 @@ struct net_buf *l2_buf_get_reserve(uint16_t reserve_head) NET_DBG("buf %p reserve %u ref %d\n", buf, reserve_head, buf->ref); #endif + packetbuf_clear(buf); + return buf; }