net/portmapper: handle pcp ADDRESS_MISMATCH response
These show up a fair amount in our logs. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
bb91cfeae7
commit
999814e9e1
|
@ -28,6 +28,12 @@ const (
|
||||||
|
|
||||||
pcpCodeOK = 0
|
pcpCodeOK = 0
|
||||||
pcpCodeNotAuthorized = 2
|
pcpCodeNotAuthorized = 2
|
||||||
|
// From RFC 6887:
|
||||||
|
// ADDRESS_MISMATCH: The source IP address of the request packet does
|
||||||
|
// not match the contents of the PCP Client's IP Address field, due
|
||||||
|
// to an unexpected NAT on the path between the PCP client and the
|
||||||
|
// PCP-controlled NAT or firewall.
|
||||||
|
pcpCodeAddressMismatch = 12
|
||||||
|
|
||||||
pcpOpReply = 0x80 // OR'd into request's op code on response
|
pcpOpReply = 0x80 // OR'd into request's op code on response
|
||||||
pcpOpAnnounce = 0
|
pcpOpAnnounce = 0
|
||||||
|
|
|
@ -791,6 +791,10 @@ func (c *Client) Probe(ctx context.Context) (res ProbeResult, err error) {
|
||||||
// provide port mapping services.
|
// provide port mapping services.
|
||||||
res.PCP = false
|
res.PCP = false
|
||||||
continue
|
continue
|
||||||
|
case pcpCodeAddressMismatch:
|
||||||
|
// A PCP service is running, but it is behind a NAT, so it can't help us.
|
||||||
|
res.PCP = false
|
||||||
|
continue
|
||||||
default:
|
default:
|
||||||
// Fall through to unexpected log line.
|
// Fall through to unexpected log line.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue