Message ID | 20240422193805.123689-1-bfukano@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 3ba031745fe0ece6676bea7fe3ee03e4736fac66 |
Headers | show |
Series | [v2] dnsproxy: Fix cached ttl update | expand |
Hello: This patch was applied to connman.git (master) by Denis Kenzior <denkenz@gmail.com>: 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!
diff --git a/src/dnsproxy.c b/src/dnsproxy.c index d4242560..23015f74 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -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);