From f28c1c851bca884e24b681eb485b9f8477e4d76e Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Sat, 15 Apr 2017 11:27:34 -0500 Subject: [PATCH] loopif: set pbuf if_idx during poll This sets the pbuf's if_idx during the loopif poll function (the equivalent netif input function). This was found during IP_PKTINFO development where p->if_idx is read and was uninitialized --- src/core/netif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/netif.c b/src/core/netif.c index a32101bc..e9627271 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -1057,6 +1057,8 @@ netif_poll(struct netif *netif) in_end->next = NULL; SYS_ARCH_UNPROTECT(lev); + in->if_idx = netif_get_index(netif); + LINK_STATS_INC(link.recv); MIB2_STATS_NETIF_ADD(stats_if, ifinoctets, in->tot_len); MIB2_STATS_NETIF_INC(stats_if, ifinucastpkts);