Skip to content

Commit e496c63

Browse files
authored
update netdev to 0.38.1 for OpenBSD support (#38)
## Description Updates netdev to the latest release (0.38.1) in order to support OpenBSD ## Breaking Changes None that I'm aware of ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
1 parent 34a396d commit e496c63

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

Cargo.lock

Lines changed: 21 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netwatch/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tracing = "0.1"
3737
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies]
3838
quinn-udp = { package = "iroh-quinn-udp", version = "0.5.5" }
3939
libc = "0.2.139"
40-
netdev = "0.37.3"
40+
netdev = "0.38.1"
4141
socket2 = { version = "0.6", features = ["all"] }
4242
tokio = { version = "1", features = [
4343
"io-util",

netwatch/src/interfaces.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::netmon::is_interesting_interface;
3838
/// Represents a network interface.
3939
#[derive(Debug, Clone)]
4040
pub struct Interface {
41-
iface: netdev::interface::Interface,
41+
iface: netdev::Interface,
4242
}
4343

4444
impl fmt::Display for Interface {
@@ -90,7 +90,10 @@ impl Interface {
9090
pub(crate) fn fake() -> Self {
9191
use std::net::Ipv4Addr;
9292

93-
use netdev::{NetworkDevice, interface::InterfaceType, mac::MacAddr};
93+
use netdev::{
94+
NetworkDevice,
95+
prelude::{InterfaceType, MacAddr, OperState},
96+
};
9497

9598
Self {
9699
iface: netdev::Interface {
@@ -115,7 +118,7 @@ impl Interface {
115118
ipv6_scope_ids: vec![],
116119
stats: None,
117120
mtu: None,
118-
oper_state: netdev::interface::OperState::Up,
121+
oper_state: OperState::Up,
119122
},
120123
}
121124
}
@@ -371,7 +374,7 @@ impl HomeRouter {
371374
/// This is used as the destination for UPnP, NAT-PMP, PCP, etc queries.
372375
pub fn new() -> Option<Self> {
373376
let gateway = Self::get_default_gateway()?;
374-
let my_ip = netdev::interface::get_local_ipaddr();
377+
let my_ip = netdev::net::ip::get_local_ipaddr();
375378

376379
Some(HomeRouter { gateway, my_ip })
377380
}

0 commit comments

Comments
 (0)