Skip to content
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

Make sockopt.interface work with UDP on Darwin #4530

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

92613hjh
Copy link

fix #4007

@Fangliding
Copy link
Member

测试过了吗?

@92613hjh
Copy link
Author

yep

@Fangliding
Copy link
Member

Fangliding commented Mar 22, 2025

if dest.Network == net.Network_UDP && !hasBindAddr(sockopt) && sockopt.Interface == ""
为什么要在这加上 sockopt.Interface 为空才往下处理? 这不是会让 sockopt.Interface 都不会对udp连接生效?

@92613hjh
Copy link
Author

92613hjh commented Mar 22, 2025

这个土制的 PacketConnWrapper会导致 IP_BOUND_IF 设置失败
逻辑同 BindAddress一致, 没设置就走PacketConnWrapper,设置就走下面
https://github.com/XTLS/Xray-core/pull/4530/files#diff-fffd9eea78d4a3cf715aa4d82845bf5e54711bd5f314aadccb4049014e198149R112-R123

@Fangliding
Copy link
Member

我记得之前试过 这个PacketConnWrapper有用的 随便绕会导致核心里有的东西炸掉 就是ListenSystemPacket传进来的conn然后对fd进行操作 wrapper一下怎么会炸呢 有问题也是ListenSystemPacket传进来的packetconn的问题吧

@92613hjh
Copy link
Author

92613hjh commented Mar 22, 2025

有问题也是ListenSystemPacket传进来的packetconn的问题吧

对,应该是 https://github.com/XTLS/Xray-core/pull/4530/files#diff-fffd9eea78d4a3cf715aa4d82845bf5e54711bd5f314aadccb4049014e198149R55-R61 的问题

@RPRX RPRX requested a review from Fangliding March 23, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] sockopt.interface 在Darwin平台未对UDP生效
2 participants