From 7a920119336f49e765e44d3c6027a999ec89aed2 Mon Sep 17 00:00:00 2001 From: likewise Date: Mon, 24 Mar 2003 12:57:00 +0000 Subject: [PATCH] Re-added pbuf_dechain() in udp_send() as it breaks current applications. --- src/core/udp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/udp.c b/src/core/udp.c index cea81ca0..d1493640 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -339,7 +339,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p) to be allocated. */ hdr = NULL; - /* succeeding in adding an UDP header to first given pbuf in chain? */ + /* not enough space to add an UDP header to first pbuf in given p chain? */ if(pbuf_header(p, UDP_HLEN)) { /* allocate header in new pbuf */ hdr = pbuf_alloc(PBUF_IP, UDP_HLEN, PBUF_RAM); @@ -405,8 +405,11 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p) /* output to IP */ err = ip_output_if(p, src_ip, &pcb->remote_ip, UDP_TTL, IP_PROTO_UDP, netif); } - /* dechain and free the header pbuf */ + /* dechain and free any header pbuf */ if(hdr != NULL) { + /* detach the header prepended earlier */ + pbuf_dechain(hdr); + /* free the header */ pbuf_free(hdr); }