-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: agent - eBPF Fix TCP DNS client request loss #9218
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note that TCP DNS adds two length bytes at the beginning of the protocol, whereas UDP DNS does not. We need to handle this properly to ensure that these two length bytes are not sent to the upper layer. When receiving data, the client does not first receive two bytes but instead receives everything at once; whereas the server receives two bytes (length) first and then receives the remaining bytes. When the client sends a request, it combines both 'A' and 'AAAA' type queries into a single request to the CoreDNS server. The first two bytes represent the length, but this length only includes the 'A' query, not the combined length of both the 'A' and 'AAAA' queries (the total size is referred to as "count" here). As a result, the length check may miss this case. This fixes the issue where the client fails to retrieve the request by adding direction judgment.
下面是客户端 wrk:worker_0 和服务端 coredns 的DNS通信行为。
双记录查询:客户端同时发送A和AAAA记录请求,是支持IPv4/IPv6双栈环境的典型行为(如Pod网络配置为双栈模式)。
服务端先收取 A 记录(上面)的查询信息进行应答:
应答记录 服务端再收取 AAAA 查询进行应答:
客户端接收(A的应答,注意它没有先读取4字节):
客户端接收( |
sharang
approved these changes
Feb 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note that TCP DNS adds two length bytes at the beginning of the protocol, whereas UDP DNS does not. We need to handle this properly to ensure that these two length bytes are not sent to the upper layer.
When receiving data, the client does not first receive two bytes but instead receives everything at once; whereas the server receives two bytes (length) first and then receives the remaining bytes.
When the client sends a request, it combines both 'A' and 'AAAA' type queries into a single request to the CoreDNS server. The first two bytes represent the length, but this length only includes the 'A' query, not the combined length of both the 'A' and 'AAAA' queries (the total size is referred to as "count" here). As a result, the length check may miss this case.
This fixes the issue where the client fails to retrieve the request by adding direction judgment.
This PR is for:
Affected branches