Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/commands/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,11 @@ pub async fn cmd_snapshot_run(args: SnapshotRunArgs) -> Result<()> {
}
}

// Verify pasta's L2 forwarding path has ARP resolved before starting health monitor.
// Verify pasta's L2 forwarding path is ready before starting health monitor.
// After snapshot restore, pasta may not have learned the guest's MAC yet.
// This probes each forwarded port to trigger and verify ARP resolution —
// no guest service needs to be running, just the guest's kernel.
// This pings the guest to trigger ARP resolution, then probes each forwarded
// port to confirm end-to-end forwarding works. Only the guest kernel needs
// to be running (no guest services required for the ARP/ping step).
network
.verify_port_forwarding()
.await
Expand Down
18 changes: 10 additions & 8 deletions src/network/pasta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,20 +687,22 @@ impl NetworkManager for PastaNetwork {
// Ping the guest to trigger ARP resolution. A successful ping (exit 0)
// proves ARP resolved AND the guest is reachable — skip the ip neigh check.
// Use 200ms timeout for ~16 retries within the 5s deadline.
let ping_result = Command::new(&nsenter_prefix[0])
let output = Command::new(&nsenter_prefix[0])
.args(&nsenter_prefix[1..])
.args(["ping", "-c", "1", "-W", "0.2", GUEST_IP])
.stdout(Stdio::null())
.stderr(Stdio::null())
.output()
.await;
.await
.context("running ping via nsenter in namespace")?;

if let Ok(ref out) = ping_result {
if out.status.success() {
info!(guest_ip = GUEST_IP, "guest reachable via ping, ARP resolved");
self.wait_for_port_forwarding().await?;
return Ok(());
}
if output.status.success() {
info!(
guest_ip = GUEST_IP,
"guest reachable via ping, ARP resolved"
);
self.wait_for_port_forwarding().await?;
return Ok(());
}

if std::time::Instant::now() > deadline {
Expand Down
Loading