p2p/nat: return correct port for ExtIP NAT (#30234)
Return the actually requested external port instead of 0 in the AddMapping implementation for `--nat extip:<IP>`.
This commit is contained in:
parent
f94baab238
commit
b0f66e34ca
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user