Add Support for IPV6 and Arbitrary Server Address

Add IPV6 support for Apple Devices
Note: Works in GUI not CLI
Adds Support for Arbitrary Server Address
This commit is contained in:
Jett Chen 2024-02-02 14:48:13 +08:00 committed by Conrad Kramer
parent cca5999214
commit 2088ae6ede
20 changed files with 276 additions and 56 deletions

View file

@ -1,4 +1,5 @@
use std::{io::Error, net::Ipv4Addr};
use std::net::Ipv6Addr;
use fehler::throws;
use tun::TunInterface;
@ -33,3 +34,15 @@ fn write_packets() {
let bytes_written = tun.send(&buf)?;
assert_eq!(bytes_written, 1504);
}
#[test]
#[throws]
#[ignore = "requires interactivity"]
#[cfg(not(target_os = "windows"))]
fn set_ipv6() {
let tun = TunInterface::new()?;
println!("tun name: {:?}", tun.name()?);
let targ_addr: Ipv6Addr = "::1".parse().unwrap();
println!("v6 addr: {:?}", targ_addr);
tun.set_ipv6_addr(targ_addr)?;
}