meh / rust-tun

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

macos: add ipv6 addr #91

Open pronebird opened 4 months ago

pronebird commented 4 months ago

This PR adds a method that provides a facility to set up IPv6 alias on tun device. Since it's possible to assign multiple IPv6 addresses on the same tun device, I figured that the method name should reflect that. This PR is very minimal and should be good enough for anyone looking to set up device with both IPv4 and IPv6

In this PR I introduce a SockAddrV6 struct that compliments SockAddr. I think that both should be united under the SockAddr umbrella and sockaddr should be replaced with sockaddr_stroage which is large enough to hold both sockaddr_in and sockaddr_in6 but I don't think that I am in capacity right now to test such change across multiple platforms.