From 75d0db5f74bb50c1e8d3b51256a9a56be0d3278d Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Sun, 16 Jan 2022 15:04:23 +0100 Subject: [PATCH 2/4] dnsproxy: Update TCP length header Patch provided by Matthias Gerstner. --- src/dnsproxy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dnsproxy.c b/src/dnsproxy.c index cd570d68c8b3..c027bcb972c4 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -2188,6 +2188,9 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol, err = sendto(sk, req->resp, req->resplen, 0, &req->sa, req->sa_len); } else { + uint16_t tcp_len = htons(req->resplen - 2); + /* correct TCP message length */ + memcpy(req->resp, &tcp_len, sizeof(tcp_len)); sk = req->client_sk; err = send(sk, req->resp, req->resplen, MSG_NOSIGNAL); } -- 2.34.1