chen08209:Concord 主线修复切网后复用旧 DNS 连接的问题,尚未发版
chen08209 说明,Concord 的 network.update 原先只清缓存、不丢弃 DNS 上游连接,interfaceChanged 为 true 时也走同一路径,切网后的 DoH 查询可能复用不再响应的旧连接并等到超时。主线提交 269be55a 改为先丢弃连接再清缓存,尚未随版本发布。作者介绍的回归测试让上游每条连接仅应答一次,检查了 interfaceChanged 的两种取值。
作者原文@chen08209Thanks for the detailed analysis and the regression test in your fork; your diagnosis is right. Fixed in
mainby 269be55a (written separately rather than taken from the fork), not yet in a release.
network.updatecleared the cached answers but kept the resolvers' upstream connections, andinterfaceChanged: truereached the same path, so the next query after a switch could go out on a DNS-over-HTTPS connection to the old network that stays open without answering, until the exchange times out. A network change now drops those connections before it clears the cache, as mihomo's default-interface callback (resolver.ResetConnection) and sing-box'sResetNetworkdo. The regression test serves DNS over HTTP from an upstream that answers once per connection and then stays silent, and checks both values ofinterfaceChanged.