From 3aca7885a73306ca4a3db290ce16761131a337ae Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 31 May 2017 14:55:39 +0800 Subject: [PATCH] pbuf: Init pbuf if_idx to NETIF_NO_INDEX in pbuf_alloced_custom Otherwise the p->pbuf.if_idx is uninitialized. Signed-off-by: Axel Lin --- src/core/pbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index f28e3104..ea505701 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -430,6 +430,7 @@ pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, struct pbuf_cust p->pbuf.len = p->pbuf.tot_len = length; p->pbuf.type_internal = (u8_t)type; p->pbuf.ref = 1; + p->pbuf.if_idx = NETIF_NO_INDEX; return &p->pbuf; } #endif /* LWIP_SUPPORT_CUSTOM_PBUF */