[PATCH] dnsproxy: Fix cached ttl update
Brian Fukano <[email protected]>
| Newsgroups | dev.linux.lists.connman |
|---|---|
| Message-ID | <[email protected]> |
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 | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index d4242560..506e1b9d 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -508,8 +508,7 @@ static void send_cached_response(int sk, const unsigned char *ptr, size_t len,
if (answers == 0)
hdr->aa = 1;
else {
- const int adj_len = len - 2;
- update_cached_ttl((unsigned char *)hdr, adj_len, ttl);
+ update_cached_ttl((unsigned char *)hdr, len, ttl);
}
debug("sk %d id 0x%04x answers %d ptr %p length %zd dns %zd",
--
2.34.1