fix: compatible issue when DNS msg not be compressed #646
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.
Background
在 PS5 上打开糖豆人会卡在启动界面,一段时间后提示网络异常,抓包显示其一直在尝试发送 api.epicgames.dev 的 DNS 请求,猜测可能是 DNS 方面的问题,对比正常配置时的 DNS 数据包,发现正常配置时,DNS 响应中的域名对应数据都是一个很短的十六进制数字且都以 C0 开头
而异常的时候,域名对应的数据都是一个完整域名的十六进制
查询资料后得知这是 DNS 协议中的压缩选项,定义在 RFC 1035 中 https://datatracker.ietf.org/doc/html/rfc1035#section-4.1.4
所以怀疑是糖豆人客户端不兼容未压缩的 DNS 消息导致的,在修改代码开启压缩后,糖豆人正常启动,如测试结果所示,DNS 消息都正常压缩了
另外查看了国内阿里和腾讯的 DNS 都是默认开启压缩的,也就是业界是推荐默认开启压缩的,所以此改动应该不会造成兼容性问题,RFC 1305 中也提到客户端应该能解析两种格式的消息
阿里的
腾讯的
抓包数据
归档.zip
Checklist
Full Changelogs
Issue Reference
Closes #338
Test Result