Cherry-picks (and tweaks) a commit from #34117 which the ANAVHEOBA did not follow up with when changes were requested.
The tweak here is to log once at LogWarning, so that users have a chance
to spot misconfiguration.
Users running on home networks with routers that don’t support PCP (Port Control Protocol) or NAT-PMP port mapping receive frequent warning-level log messages every few minutes:
“pcp: Mapping failed with result NOT_AUTHORIZED (code 2)”
This is expected behavior for many consumer routers that have PCP disabled by default, not an actionable error.
Add explicit constants for the NOT_AUTHORIZED result code (value 2) for both NAT-PMP and PCP protocols. Log the first NOT_AUTHORIZED failure at warning level for visibility, then downgrade subsequent occurrences to LogDebug to avoid log noise. Other failure types continue to warn unconditionally.
Fixes #34114