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 <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2017-05-31 14:55:39 +08:00 committed by Dirk Ziegelmeier
parent ba1cf2fa44
commit 3aca7885a7

View File

@ -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 */