Update natupnp.go

This commit is contained in:
crStiv 2025-01-27 00:54:42 +01:00 committed by GitHub
parent f0e8a3e9c8
commit 07089d36e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -82,7 +82,7 @@ func (n *upnp) ExternalIP() (addr net.IP, err error) {
func (n *upnp) AddMapping(protocol string, extport, intport int, desc string, lifetime time.Duration) (uint16, error) {
ip, err := n.internalAddress()
if err != nil {
return 0, nil // TODO: Shouldn't we return the error?
return 0, err
}
protocol = strings.ToUpper(protocol)
lifetimeS := uint32(lifetime / time.Second)