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
This commit is contained in:
Joel Cunningham 2017-04-15 11:27:34 -05:00
parent 1e02f9e88b
commit f28c1c851b

View File

@ -1057,6 +1057,8 @@ netif_poll(struct netif *netif)
in_end->next = NULL; in_end->next = NULL;
SYS_ARCH_UNPROTECT(lev); SYS_ARCH_UNPROTECT(lev);
in->if_idx = netif_get_index(netif);
LINK_STATS_INC(link.recv); LINK_STATS_INC(link.recv);
MIB2_STATS_NETIF_ADD(stats_if, ifinoctets, in->tot_len); MIB2_STATS_NETIF_ADD(stats_if, ifinoctets, in->tot_len);
MIB2_STATS_NETIF_INC(stats_if, ifinucastpkts); MIB2_STATS_NETIF_INC(stats_if, ifinucastpkts);