[Bug] Maybe open_others.go need use 4 as default offset.
myloft opened this issue · comments
Verify steps
- Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
- I have searched on the issue tracker for a related issue.
Version
v2.5.1
What OS are you seeing the problem on?
No response
Description
I try to use tun2socks on ios via fd. Tun2socks will use open_others.go to open fd. It not works. The default offset is zero. But packet read from tun fd have TUN_PI header. I change offset to 4. It works.
I think ios is the vast majority of non-linux scenarios where iobased is used. Maybe we need set default to 4 or giving a args.
CLI or Config
No response
Logs
No response
How to Reproduce
No response
Is TUN_PI header configurable on iOS?
I'm not familiar with ios, but I agree that we may need to set offsets respectively for different OS.
https://stackoverflow.com/questions/69260852/ios-network-extension-packet-parsing/69487795#69487795
@xjasonlyu Yes, It has 4 bytes prefix and can not configurable.
Okay, maybe we should add a 4 bytes offset for fd open function. Would you like to open a PR?
OK, i will open a PR.