mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
Converted some DEBUGFs that should never happen to LWIP_ASSERTs
This commit is contained in:
parent
974cf08e5d
commit
a6b0d40f9d
@ -103,7 +103,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
struct pbuf *r;
|
struct pbuf *r;
|
||||||
/* switch p->payload to ip header */
|
/* switch p->payload to ip header */
|
||||||
if (pbuf_header(p, hlen)) {
|
if (pbuf_header(p, hlen)) {
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: moving p->payload to ip header failed\n"));
|
LWIP_ASSERT("icmp_input: moving p->payload to ip header failed\n", 0);
|
||||||
goto memerr;
|
goto memerr;
|
||||||
}
|
}
|
||||||
/* allocate new packet buffer with space for link headers */
|
/* allocate new packet buffer with space for link headers */
|
||||||
@ -114,13 +114,13 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
/* copy the whole packet including ip header */
|
/* copy the whole packet including ip header */
|
||||||
if (pbuf_copy(r, p) != ERR_OK) {
|
if (pbuf_copy(r, p) != ERR_OK) {
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: copying to new pbuf failed\n"));
|
LWIP_ASSERT("cmp_input: copying to new pbuf failed\n", 0);
|
||||||
goto memerr;
|
goto memerr;
|
||||||
}
|
}
|
||||||
iphdr = r->payload;
|
iphdr = r->payload;
|
||||||
/* switch r->payload back to icmp header */
|
/* switch r->payload back to icmp header */
|
||||||
if (pbuf_header(r, -hlen)) {
|
if (pbuf_header(r, -hlen)) {
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: restoring original p->payload failed\n"));
|
LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0);
|
||||||
goto memerr;
|
goto memerr;
|
||||||
}
|
}
|
||||||
/* free the original p */
|
/* free the original p */
|
||||||
@ -130,7 +130,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
} else {
|
} else {
|
||||||
/* restore p->payload to point to icmp header */
|
/* restore p->payload to point to icmp header */
|
||||||
if (pbuf_header(p, -(s16_t)(PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
|
if (pbuf_header(p, -(s16_t)(PBUF_IP_HLEN + PBUF_LINK_HLEN))) {
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: restoring original p->payload failed\n"));
|
LWIP_ASSERT("icmp_input: restoring original p->payload failed\n", 0);
|
||||||
goto memerr;
|
goto memerr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user