p2p/nat: return correct port for ExtIp NAT

This commit is contained in:
Daniel Knopik 2024-07-26 19:28:26 +02:00
parent f94baab238
commit 1e0b30bee5
No known key found for this signature in database
GPG key ID: C56F35A74383E739

View file

@ -138,8 +138,10 @@ func (n ExtIP) String() string { return fmt.Sprintf("ExtIP(%v)", ne
// These do nothing. // These do nothing.
func (ExtIP) AddMapping(string, int, int, string, time.Duration) (uint16, error) { return 0, nil } func (ExtIP) AddMapping(protocol string, extport, intport int, name string, lifetime time.Duration) (uint16, error) {
func (ExtIP) DeleteMapping(string, int, int) error { return nil } return uint16(extport), nil
}
func (ExtIP) DeleteMapping(string, int, int) error { return nil }
// Any returns a port mapper that tries to discover any supported // Any returns a port mapper that tries to discover any supported
// mechanism on the local network. // mechanism on the local network.