net/portmapper: add start of self-contained portmapper integration tests

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-08-05 10:32:13 -07:00
parent 98d36ee18d
commit e6d4ab2dd6
3 changed files with 186 additions and 1 deletions

View File

@@ -726,7 +726,7 @@ func (c *Client) Probe(ctx context.Context) (res ProbeResult, err error) {
}
}
var pmpReqExternalAddrPacket = []byte{0, 0} // version 0, opcode 0 = "Public address request"
var pmpReqExternalAddrPacket = []byte{pmpVersion, pmpOpMapPublicAddr} // 0, 0
const (
upnpPort = 1900 // for UDP discovery only; TCP port discovered later