windows: don't discover default IP, removes winpcap dependency
This commit is contained in:
parent
3e65289b85
commit
7221ac5e88
1 changed files with 20 additions and 10 deletions
|
@ -863,6 +863,15 @@ impl NodeStatus {
|
||||||
/// Obtain the list of currently available IP addresses on all non-loopback
|
/// Obtain the list of currently available IP addresses on all non-loopback
|
||||||
/// interfaces, optionally filtering them to be inside a given IpNet.
|
/// interfaces, optionally filtering them to be inside a given IpNet.
|
||||||
fn get_default_ip(filter_ipnet: Option<ipnet::IpNet>) -> Option<IpAddr> {
|
fn get_default_ip(filter_ipnet: Option<ipnet::IpNet>) -> Option<IpAddr> {
|
||||||
|
// pnet creates a dependency on winpcap, which is a giant pain to get working with
|
||||||
|
// cross-compilation.
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
{
|
||||||
pnet_datalink::interfaces()
|
pnet_datalink::interfaces()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
// filter down and loopback interfaces
|
// filter down and loopback interfaces
|
||||||
|
@ -875,6 +884,7 @@ fn get_default_ip(filter_ipnet: Option<ipnet::IpNet>) -> Option<IpAddr> {
|
||||||
})
|
})
|
||||||
.map(|ipn| ipn.ip())
|
.map(|ipn| ipn.ip())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn get_rpc_public_addr(config: &Config) -> Option<SocketAddr> {
|
fn get_rpc_public_addr(config: &Config) -> Option<SocketAddr> {
|
||||||
match &config.rpc_public_addr {
|
match &config.rpc_public_addr {
|
||||||
|
|
Loading…
Reference in a new issue