++ Bugfixes:
+ 2013-01-11: Simon Goldschmidt
+ * raw.c: fixed bug #38066 Raw pcbs can alter packet without eating it
+
2012-09-26: Simon Goldschmidt
* api_msg.c: fixed bug #37405 'err_tcp()' uses already freed 'netconn' object
{
/* receive callback function available? */
if (pcb->recv.ip4 != NULL) {
+#ifndef LWIP_NOASSERT
+ void* old_payload = p->payload;
+#endif
/* the receive callback function did not eat the packet? */
eaten = pcb->recv.ip4(pcb->recv_arg, pcb, p, ip_current_src_addr());
if (eaten != 0) {
pcb->next = raw_pcbs;
raw_pcbs = pcb;
}
+ } else {
+ /* sanity-check that the receive callback did not alter the pbuf */
+ LWIP_ASSERT("raw pcb recv callback altered pbuf payload pointer without eating packet",
+ p->payload == old_payload);
}
}
/* no receive callback function was set for this raw PCB */