You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PMP requests continue even if library throws error #10486
Suggestion: do return nil in all error cases, and log error; that way, it would have been a lot easier to see that my router only supports v2 (PCP) instead of having to look at a network dump.
I suspect that because of this, upnp is also not tried when the PMP code looks fine.
Hi, I took a look at this and I think you're right -- the error handling in Discover() has a gap where non-timeout errors fall through without returning nil. This means a wrapper device gets created for a gateway that doesn't actually speak NAT-PMP.
I've put up a fix in #10607 that moves the return nil outside the inner conditional branches so all error cases are handled. It also adds a debug log line for non-timeout errors, which should make it easier to diagnose situations like yours where the router only supports PCP.
Activity
fix(pmp): return nil on all GetExternalAddress errors
mango766 commentedon Mar 16, 2026
Hi, I took a look at this and I think you're right -- the error handling in
Discover()has a gap where non-timeout errors fall through without returningnil. This means awrapperdevice gets created for a gateway that doesn't actually speak NAT-PMP.I've put up a fix in #10607 that moves the
return niloutside the inner conditional branches so all error cases are handled. It also adds a debug log line for non-timeout errors, which should make it easier to diagnose situations like yours where the router only supports PCP.chore: trivial fixes (syncthing#10650)
[codex] Merge upstream stable v2.1.1 into main (#23)