Add IPv6 prefix handling to unix tun interface

This commit is contained in:
Conrad Kramer 2025-10-29 19:08:32 -07:00
parent 848efac15d
commit 3fb0269d7c
10 changed files with 229 additions and 41 deletions

View file

@ -1,5 +1,5 @@
use std::{io::Error, net::Ipv4Addr};
use std::net::Ipv6Addr;
use std::{io::Error, net::Ipv4Addr};
use fehler::throws;
use tun::TunInterface;
@ -44,5 +44,5 @@ fn set_ipv6() {
println!("tun name: {:?}", tun.name()?);
let targ_addr: Ipv6Addr = "::1".parse().unwrap();
println!("v6 addr: {:?}", targ_addr);
tun.set_ipv6_addr(targ_addr)?;
}
tun.add_ipv6_addr(targ_addr, 128)?;
}