Skip to content

fix(nat-pmp): avoid polling same future multiple times#371

Open
Filang666 wants to merge 3 commits into
eepnet:masterfrom
Filang666:master
Open

fix(nat-pmp): avoid polling same future multiple times#371
Filang666 wants to merge 3 commits into
eepnet:masterfrom
Filang666:master

Conversation

@Filang666
Copy link
Copy Markdown

The with_retries_and_timeout function polls the same future repeatedly, which is illegal in async Rust and causes a panic async fn resumed after completion from the natpmp crate.

This PR removes that function and inlines retry+timeout loops directly into each operation, creating a fresh future on every attempt.

Result: no more panic. NAT-PMP works (or correctly falls back to UPnP).

Tested locally with a router that does not support NAT-PMP – fallback to UPnP works, no crash.

Filang666 added 3 commits May 27, 2026 19:56
fix(nat-pmp): recreate future on each retry to avoid illegal polling

Previously, `with_retries_and_timeout` polled the same future multiple times,
causing a panic. Now it accepts a closure that returns a fresh future on each
attempt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant