mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-20 07:06:53 +08:00
ethernetif.c: update netif->input calls to check return value. In older ports, it's a good idea to upgrade them, even if before, there could be another problem (access to an uninitialized mailbox).
This commit is contained in:
@@ -237,7 +237,11 @@ ethernetif_input(struct netif *netif)
|
||||
case ETHTYPE_IP:
|
||||
case ETHTYPE_ARP:
|
||||
/* full packet send to tcpip_thread to process */
|
||||
pnetif->input( p, pnetif);
|
||||
if (netif->input(p, netif)!=ERR_OK)
|
||||
{ LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_init: IP input error\n"));
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
#else /* ETHARP_TCPIP_ETHINPUT */
|
||||
@@ -252,7 +256,11 @@ ethernetif_input(struct netif *netif)
|
||||
/* skip Ethernet header */
|
||||
pbuf_header(p, -sizeof(struct eth_hdr));
|
||||
/* pass to network layer */
|
||||
netif->input(p, netif);
|
||||
if (netif->input(p, netif)!=ERR_OK)
|
||||
{ LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_init: IP input error\n"));
|
||||
pbuf_free(p);
|
||||
p = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
/* ARP packet? */
|
||||
|
||||
Reference in New Issue
Block a user