From 8ff9dfdea30a0d86693246de4c814f263d0cb934 Mon Sep 17 00:00:00 2001 From: Old-Ding Date: Mon, 6 Jul 2026 09:53:38 +0800 Subject: [PATCH] libs: netdb: Advance stream buffers by transfer count Update the DNS stream send and receive helpers to advance their buffers by the number of bytes actually transferred. Advancing by the original remaining length skips data when send() or recv() completes partially. Signed-off-by: Old-Ding --- libs/libc/netdb/lib_dnsquery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libc/netdb/lib_dnsquery.c b/libs/libc/netdb/lib_dnsquery.c index 51740ce58d4..d3231a9adf6 100644 --- a/libs/libc/netdb/lib_dnsquery.c +++ b/libs/libc/netdb/lib_dnsquery.c @@ -140,7 +140,7 @@ static ssize_t stream_send(int fd, FAR const void *buf, size_t len) break; } - buf = (FAR const uint8_t *)buf + len; + buf = (FAR const uint8_t *)buf + ret; len -= ret; total += ret; } @@ -186,7 +186,7 @@ static ssize_t stream_recv(int fd, FAR void *buf, size_t len) break; } - buf = (FAR uint8_t *)buf + len; + buf = (FAR uint8_t *)buf + ret; len -= ret; total += ret; }