From b39592f68a29e0d0dfd91045def1a7cf1b014ba1 Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Fri, 10 Jun 2022 22:13:24 -0700 Subject: [PATCH] net/portmapper: make pcpCodeNotAuthorized log more descriptive If PCP is present but disabled, turning it on might help get direct connections. Signed-off-by: Denton Gentry (cherry picked from commit de4c635e54b81bea223d00f97e043c6abd2e54ff) --- net/portmapper/pcp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/portmapper/pcp.go b/net/portmapper/pcp.go index 43417947e..66b93845c 100644 --- a/net/portmapper/pcp.go +++ b/net/portmapper/pcp.go @@ -115,6 +115,9 @@ func parsePCPMapResponse(resp []byte) (*pcpMapping, error) { if !ok { return nil, fmt.Errorf("Invalid PCP common header") } + if res.ResultCode == pcpCodeNotAuthorized { + return nil, fmt.Errorf("PCP is implemented but not enabled in the router") + } if res.ResultCode != pcpCodeOK { return nil, fmt.Errorf("PCP response not ok, code %d", res.ResultCode) }