meh / rust-tun

TUN device creation and handling.
340 stars 133 forks source link

Fix the issue of macos netmask setting #56

Closed BranLiang closed 1 year ago

BranLiang commented 1 year ago

Currently, you can't set the netmask in macos system. It will always be netmask 0xff000000, no matter what kind of netmask is given to the program.

Seems command siocsifnetmask doesn't work as expected. The fix tries to make another system call siocaifaddr, which was defined but not used.

Tophatting:

Screenshot 2023-02-08 at 14 15 27