updated packages
This commit is contained in:
parent
abf1101484
commit
807dffa3be
4 changed files with 72 additions and 9 deletions
|
|
@ -114,6 +114,25 @@ impl TunInterface {
|
|||
Ipv4Addr::from(u32::from_be(addr.sin_addr.s_addr))
|
||||
}
|
||||
|
||||
#[throws]
|
||||
#[instrument]
|
||||
pub fn ipv6_addrs(&self) -> Vec<Ipv6Addr> {
|
||||
let ip_addrs = self.ip_addrs()?;
|
||||
let mut ipv6_addrs: Vec<Ipv6Addr> = vec![];
|
||||
|
||||
for ip_addr in ip_addrs.iter() {
|
||||
if ip_addr.is_ipv6() {
|
||||
match ip_addr {
|
||||
IpAddr::V6(addr) => {
|
||||
ipv6_addrs.push(*addr);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
ipv6_addrs
|
||||
}
|
||||
|
||||
#[throws]
|
||||
#[instrument]
|
||||
pub fn set_broadcast_addr(&self, addr: Ipv4Addr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue