mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-10 01:23:48 +08:00
Reverted change for bug #27252 (Address pointer invalid after freeing pbuf in UDP receive callback) as it made more problems than before :-(
This commit is contained in:
@@ -281,10 +281,8 @@ udp_input(struct pbuf *p, struct netif *inp)
|
||||
snmp_inc_udpindatagrams();
|
||||
/* callback */
|
||||
if (pcb->recv != NULL) {
|
||||
/* copy the source address to make it independent of the pbuf */
|
||||
struct ip_addr src_addr = iphdr->src;
|
||||
/* now the recv function is responsible for freeing p */
|
||||
pcb->recv(pcb->recv_arg, pcb, p, &src_addr, src);
|
||||
pcb->recv(pcb->recv_arg, pcb, p, &iphdr->src, src);
|
||||
} else {
|
||||
/* no recv function registered? then we have to free the pbuf! */
|
||||
pbuf_free(p);
|
||||
|
||||
Reference in New Issue
Block a user