[PATCH 01/10] net: lwip: return ERR_ABRT after aborting wget receive

James Hilliard <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <20260825-submit-lwip-runtime-netconsole-v1-v1-1-0892966aa758@gmail.com>
altcp_abort() deallocates the connection PCB. A raw TCP receive callback
which calls it must return ERR_ABRT so the TCP input path does not access
the released PCB.

The wget receive callback instead returns ERR_BUF when storing received
data fails. Return ERR_ABRT after aborting the connection.

Fixes: e40c910e88a9 ("net-lwip: wget: add LMB and buffer checks")
Signed-off-by: James Hilliard <[email protected]>
---
 net/lwip/wget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index 247ece18e2b..e8930da410b 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -206,7 +206,7 @@ static err_t httpc_recv_cb(void *arg, struct altcp_pcb *pcb, struct pbuf *pbuf,
 	for (buf = pbuf; buf; buf = buf->next) {
 		if (store_block(ctx, buf->payload, buf->len) < 0) {
 			altcp_abort(pcb);
-			ret = ERR_BUF;
+			ret = ERR_ABRT;
 			goto out;
 		}
 	}

-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.