Skip to content

Commit de4c635

Browse files
committed
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 <dgentry@tailscale.com>
1 parent 3ac8ab1 commit de4c635

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/portmapper/pcp.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ func parsePCPMapResponse(resp []byte) (*pcpMapping, error) {
115115
if !ok {
116116
return nil, fmt.Errorf("Invalid PCP common header")
117117
}
118+
if res.ResultCode == pcpCodeNotAuthorized {
119+
return nil, fmt.Errorf("PCP is implemented but not enabled in the router")
120+
}
118121
if res.ResultCode != pcpCodeOK {
119122
return nil, fmt.Errorf("PCP response not ok, code %d", res.ResultCode)
120123
}

0 commit comments

Comments
 (0)