* Fix all uses of pbuf_header to check the return value. In some

cases just assert if it fails as I'm not sure how to fix them, but
    this is no worse than before when they would carry on regardless
    of the failure.
This commit is contained in:
kieranm
2007-03-21 12:55:00 +00:00
parent b422864d5d
commit 7294cb080b
12 changed files with 106 additions and 34 deletions

View File

@@ -138,9 +138,14 @@ ethernet_input(struct pbuf *p, struct netif *netif)
etharp_ip_input( netif, p);
#endif
/* skip Ethernet header */
pbuf_header(p, (s16_t)(-sizeof(struct eth_hdr)));
/* pass to IP layer */
ip_input(p, netif);
if(pbuf_header(p, (s16_t)(-sizeof(struct eth_hdr)))) {
LWIP_ASSERT("Can't move over header in packet", 0);
pbuf_free(p);
p = NULL;
}
else
/* pass to IP layer */
ip_input(p, netif);
break;
case ETHTYPE_ARP: