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:
fbernon 2007-03-22 09:09:27 +00:00
parent 776c01e60b
commit 5fff6e7ff8
2 changed files with 15 additions and 2 deletions

View File

@ -71,6 +71,11 @@ HISTORY
++ Bug fixes: ++ Bug fixes:
2007-03-22 Frédéric Bernon
* 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).
2007-03-21 Simon Goldschmidt 2007-03-21 Simon Goldschmidt
* sockets.c: fixed bug #5067 (essentialy a signed/unsigned warning fixed * sockets.c: fixed bug #5067 (essentialy a signed/unsigned warning fixed
by casting to unsigned). by casting to unsigned).

View File

@ -237,7 +237,11 @@ ethernetif_input(struct netif *netif)
case ETHTYPE_IP: case ETHTYPE_IP:
case ETHTYPE_ARP: case ETHTYPE_ARP:
/* full packet send to tcpip_thread to process */ /* 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; break;
#else /* ETHARP_TCPIP_ETHINPUT */ #else /* ETHARP_TCPIP_ETHINPUT */
@ -252,7 +256,11 @@ ethernetif_input(struct netif *netif)
/* skip Ethernet header */ /* skip Ethernet header */
pbuf_header(p, -sizeof(struct eth_hdr)); pbuf_header(p, -sizeof(struct eth_hdr));
/* pass to network layer */ /* 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; break;
/* ARP packet? */ /* ARP packet? */