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

M 系列配置报错 Failed to create TUN device: invalid argument #46

Closed
bestony opened this issue Sep 10, 2024 · 6 comments
Closed

M 系列配置报错 Failed to create TUN device: invalid argument #46

bestony opened this issue Sep 10, 2024 · 6 comments

Comments

@bestony
Copy link

bestony commented Sep 10, 2024

DEBUG: wg-corplink(utun114514123skj) 2024/09/10 10:29:14 Starting wg-corplink version 0.0.20220316-46-ga121834
ERROR: wg-corplink(utun114514123skj) 2024/09/10 10:29:14 Failed to create TUN device: invalid argument

启动命令:corplink-rs /etc/corplink-rs/config.json, config 的局部内容如下

{
  "interface_name": "utun114514123skj",
  "device_name": "DollarOS",
  "debug_wg": true,
  "state": "Login",
  "vpn_server_name": null,
  "vpn_select_strategy": null
}
@PinkD
Copy link
Owner

PinkD commented Sep 10, 2024

请参考 README 中「macos 特殊说明」章节

@PinkD PinkD closed this as completed Sep 10, 2024
@bestony
Copy link
Author

bestony commented Sep 11, 2024

调整后也没有用

➜  ~ RUST_BACKTRACE=1 corplink-rs /etc/corplink-rs/config.json
DEBUG: wg-corplink(utun1145141) 2024/09/11 08:44:29 Starting wg-corplink version 0.0.20220316-46-ga121834
ERROR: wg-corplink(utun1145141) 2024/09/11 08:44:29 Failed to create TUN device: invalid argument

可以看到这里的 device name 是 utun1145141 ,符合 macOS 的特殊说明要求。

@PinkD
Copy link
Owner

PinkD commented Sep 11, 2024

  1. 系统版本
  2. corplink-rs 版本
  3. 是否使用 root 权限启动本程序

@PinkD PinkD reopened this Sep 11, 2024
@bestony
Copy link
Author

bestony commented Sep 12, 2024

  1. 已经是 root
图片
  1. 系统 14.6.1 (23G93)
  2. corp-link-rs 0.5.0 最新的 master 1e98c16

@PinkD
Copy link
Owner

PinkD commented Sep 12, 2024

经过测试, macos 的 utun 接口后的 index 类型应该为 int16 ,即最高为 32767 ,改成小于等于这个数即可

@PinkD PinkD closed this as completed Sep 12, 2024
@PinkD
Copy link
Owner

PinkD commented Sep 12, 2024

https://opensource.apple.com/source/xnu/xnu-4570.1.46/bsd/net/if_utun.c.auto.html
网上搜到的关联的源码里是 uint32 类型,不清楚是什么歌情况

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

No branches or pull requests

2 participants