Skip to content

Commit

Permalink
fix(netcheck): Make ICMP ping optional (#1137)
Browse files Browse the repository at this point in the history
On Linux you don't have permission to send ICMP pings by default, so
creating the pinger will fail.  This should not make all of netcheck
fail.
  • Loading branch information
flub committed Jun 27, 2023
1 parent de43b59 commit ac6bb1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion iroh-net/src/hp/netcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,13 @@ impl ReportState {
};

let pinger = if self.plan.has_https_probes() {
Some(Pinger::new().await.context("failed to create pinger")?)
match Pinger::new().await {
Ok(pinger) => Some(pinger),
Err(err) => {
debug!("failed to create pinger: {err:#}");
None
}
}
} else {
None
};
Expand Down
1 change: 1 addition & 0 deletions iroh-net/src/hp/netcheck/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl ProbePlan {
pub fn has_https_probes(&self) -> bool {
self.keys().any(|k| k.ends_with("https"))
}

/// Generates the probe plan for a `DerpMap`, given the most recent report and
/// whether IPv6 is configured on an interface.
pub fn new(dm: &DerpMap, if_state: &interfaces::State, last: Option<&Report>) -> ProbePlan {
Expand Down

0 comments on commit ac6bb1a

Please sign in to comment.