SagerNet / SagerNet

The universal proxy toolchain for Android
https://sagernet.org
Other
5.7k stars 940 forks source link

当设备无v6地址时连接绕过路由的双栈域名,会因为无法回落至ipv4而导致无法打开 #519

Open Loukky opened 2 years ago

Loukky commented 2 years ago

描述问题

当设备无v6地址时连接绕过路由的双栈域名,会因为无法回落至ipv4而导致无法打开

如何复现

1 连接一个无ipv6地址的WiFi或者关闭数据流量的ipv6 2 在路由配置里面仅设置绕过 geoip:cn 而geosite:cn关掉 3 在设置-路由设置 启用ipv6路由 4 打开一个国内的双栈域名,如:www.gov.cn 观察日志,回发现sagernet会尝试通过ipv6去连接,但由于设备没有ipv6 地址,而又不会回落至ipv4 连接,导致连接失败

调试信息

关于 -> 导出调试信息

如果您不直接发送文件, 请使用 Markdown code 块格式, 否则您的 issue 将被直接关闭!

--------- beginning of main
I/v2ray-core: app/dispatcher: taking detour [dns-out] for [udp:172.19.0.2:53]
I/v2ray-core: proxy/dns: handling DNS traffic to tcp:dns.google
D/v2ray-core: app/dns: domain www.gov.cn will use DNS in order: [DOH//https://dns.google/dns-query]
I/v2ray-core: app/dispatcher: taking detour [dns-out] for [udp:172.19.0.2:53]
I/v2ray-core: proxy/dns: handling DNS traffic to tcp:dns.google
D/v2ray-core: app/dns: domain www.gov.cn will use DNS in order: [DOH//https://dns.google/dns-query]
D/v2ray-core: app/dns: DOH//https://dns.google/dns-query got answer: www.gov.cn -> TypeAAAA [2409:8c04:1007:a002::1:2d 2409:8c02:24c:70::ed 2409:8c20:5021:102::8000:21b 2409:8c04:1007:a002::1:14 2409:8c28:34b0:a::21e 2409:8c04:1007:a002::1:9]
D/v2ray-core: app/dns: DOH//https://dns.google/dns-query got answer: www.gov.cn -> TypeA [120.226.43.16 120.226.43.19 120.226.43.22 120.226.43.7 120.226.43.14 120.226.43.17 120.226.43.20 120.226.43.12 120.226.43.15 120.226.43.18 120.226.43.21]
D/v2ray-core: app/dispatcher: dispatch conn to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: app/dispatcher: taking detour [bypass] for [tcp:[2409:8c04:1007:a002::1:2d]:80]
I/v2ray-core: proxy/freedom: opening connection to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: transport/internet/tcp: dialing TCP to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: transport/internet/tcp: dialing TCP to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: transport/internet/tcp: dialing TCP to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: transport/internet/tcp: dialing TCP to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: transport/internet/tcp: dialing TCP to tcp:[2409:8c04:1007:a002::1:2d]:80
I/v2ray-core: app/proxyman/outbound: failed to process outbound traffic > proxy/freedom: failed to open connection to tcp:[2409:8c04:1007:a002::1:2d]:80 > common/retry: [network is unreachable] > common/retry: all retry attempts failed

预期行为

希望可以在ipv6 连接失败以后尝试通过ipv4 连接

屏幕截图

设备信息

附加上下文

enfein commented 2 years ago

这个不能算 bug。大多数情况下用户知道代理服务器是否支持 IPv6,如果不支持把 IPv6 关掉就可以了。

txtyb commented 2 years ago

这个不能算 bug。大多数情况下用户知道代理服务器是否支持 IPv6,如果不支持把 IPv6 关掉就可以了。

如果这样考虑的话,那这个选项就应当做在每个节点的设置内,而不是全局选项。