XDNS finalmask: apply sockopt to outgoing sockets for resolvers.#5976
XDNS finalmask: apply sockopt to outgoing sockets for resolvers.#5976
Conversation
|
这样肯定不行 太丑了 |
|
#5872 从一开始就是AI slop想法自己打破封装 在finalmask里乱搞就算了别霍霍别的包 |
|
|
|
Another way to partially fix is to use the |
132aecc to
6ddda1a
Compare
|
而且udp本来就可以对着设置好的packet conn writeto readfrom 不知道那玩意为什么还得自己单开连接 |
…ckopt and sendThrough settings.
6ddda1a to
a59c68d
Compare
|
@Fangliding please review the new version of this PR (it's better to view without whitespace changes). Only 2 files changed now. New sockets for resolvers are not created anymore. |
|
@LjhAUMEM XDNS 目前只支持 UDP,我觉得是可以先改成 WriteTo 而不是创建一堆新 sockets,你看下这个 PR 可以合并不 |
开新 socket 不是你说的吗 #5872 (comment)
完全不能,现在非常反感 ai 人,标题说的应用 socketopt 现在又只有改回单 conn 的修改 |
|
|
|
说实话不好动 单socket反而简单点 |
As16 对ipv4可以用 一个很经典的坑 返回一个 ipv4 mapped ipv6 在标准库里很多地方都视为是一样的 但是也导致了很多麻烦 比如在需要的时候区分不出真的 ipv4 和 mapped ipv4 以及一些标准库函数返回哪种 ip 还在左右脑互搏 |
Yes. I switched back to a single PacketConn.
normalizeAddrPort is used only to compare the address of the received packet with the address of the resolver from the configuration. This normalized address isn't used for sending or anything else. So I don't think it will cause any problems. Without normalization addresses were sometimes incomparable. One was [::ffff.1.2.3.4]:53, and the other was 1.2.3.4:53 |
|
@26X23 用我那一版吧,你现在这个除了改回单 conn 还相当于把单个 resolver 的 domain 和 ip 绑定了,然后还没改完,writeto 和 sendloop 那里还是乱序的
|
|
|
|
那就不叫udp mask了 跟我之前吐槽的那样实质性变成第二层transport |
|
这 udp 的意思是适用于 udp 而不是一定还是以 udp 的形式发出, 某种程度上来说它确实是又一层 transport, |
|
@LjhAUMEM I tested your PR (8bd1c92), it seems to work.
I compare the pair (domain, IP-address) to match current behavior. Because one IP-address could be used with multiple domains (e.g.: t1.xdns.com+udp://1.1.1.1:53, t2.xdns.com+udp://1.1.1.1:53, t3.xdns.com+udp://8.8.8.8:53). In your PR domain isn't used to increment resolverSend, therefore first domain (t1.xdns.com) will be selected more frequently than second (t2.xdns.com) in the condition |


Policy-based routing with XDNS was broken in v26.4.13. Since then XDNS creates new sockets for resolvers and doesn't apply sockopt (and mark). Also sendThrough isn't used.
There is no need to create new sockets for every resolver. One preconfigured
raw net.PacketConnmay be used for all resolvers.