net/portmapper: make pcpCodeNotAuthorized log more descriptive
If PCP is present but disabled, turning it on might help
get direct connections.
@@ -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)
}
