Skip to contentSkip to conversation

dnsproxy: Fix cached ttl update

PATCH Applied Brian Fukano 2 participants 2 messages Apr 22, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dnsproxy: Fix cached ttl update

This bug was exposed after fixing the signedness comparison warnings found in dnsproxy.c update_cached_ttl() consistently comes up two bytes short when processing the last record.

---
 src/dnsproxy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
src/dnsproxy.c +2 -4
index d4242560..23015f74 100644
@@ -507,10 +507,8 @@ static void send_cached_response(int sk, const unsigned char *ptr, size_t len,
 	/* if this is a negative reply, we are authoritative */
 	if (answers == 0)
 		hdr->aa = 1;
-	else {
-		const int adj_len = len - 2;
-		update_cached_ttl((unsigned char *)hdr, adj_len, ttl);
-	}
+	else
+		update_cached_ttl((unsigned char *)hdr, dns_len, ttl);
 
 	debug("sk %d id 0x%04x answers %d ptr %p length %zd dns %zd",
 		sk, hdr->id, answers, ptr, len, dns_len);
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to connman.git (master) by Denis Kenzior <[email protected]>:

Hello:

This patch was applied to connman.git (master)
by Denis Kenzior <[email protected]>:

Quoted 6 lines · On Mon, 22 Apr 2024 12:38:05 -0700 you wrote:

This bug was exposed after fixing the signedness comparison warnings found in dnsproxy.c update_cached_ttl() consistently comes up two bytes short when processing the last record.

---
 src/dnsproxy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Here is the summary with links:
- [v2] dnsproxy: Fix cached ttl update

    https://git.kernel.org/pub/scm/network/connman/connman.git/?id=3ba031745fe0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html