Skip to content

Commit 1e0b30b

Browse files
committed
p2p/nat: return correct port for ExtIp NAT
1 parent f94baab commit 1e0b30b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

p2p/nat/nat.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ func (n ExtIP) String() string { return fmt.Sprintf("ExtIP(%v)", ne
138138

139139
// These do nothing.
140140

141-
func (ExtIP) AddMapping(string, int, int, string, time.Duration) (uint16, error) { return 0, nil }
142-
func (ExtIP) DeleteMapping(string, int, int) error { return nil }
141+
func (ExtIP) AddMapping(protocol string, extport, intport int, name string, lifetime time.Duration) (uint16, error) {
142+
return uint16(extport), nil
143+
}
144+
func (ExtIP) DeleteMapping(string, int, int) error { return nil }
143145

144146
// Any returns a port mapper that tries to discover any supported
145147
// mechanism on the local network.

0 commit comments

Comments
 (0)