Create set_ipv6_addr

This adds a new method for setting an ipv6 address on an interface
This commit is contained in:
Conrad Kramer 2023-05-20 05:07:14 -10:00
parent b94356dfb7
commit cc30fcd34c
3 changed files with 40 additions and 6 deletions

View file

@ -1,7 +1,7 @@
use fehler::throws;
use tun::TunInterface;
use std::io::Error;
use std::net::Ipv4Addr;
use std::net::{Ipv4Addr, Ipv6Addr};
use tun::TunInterface;
#[test]
#[throws]
@ -19,4 +19,16 @@ fn test_set_get_ipv4() {
let result = tun.ipv4_addr()?;
assert_eq!(addr, result);
}
}
#[test]
#[throws]
fn test_set_get_ipv6() {
let tun = TunInterface::new()?;
let addr = Ipv6Addr::new(1, 1, 1, 1, 1, 1, 1, 1);
tun.set_ipv6_addr(addr)?;
// let result = tun.ipv6_addr()?;
// assert_eq!(addr, result);
}