portfwd.go | 7 ------- diff --git a/portfwd.go b/portfwd.go index e2c22d42d1175083eef6b2c4e403cb8dfd8d4e00..64436c6543f0a865f9028ab95177663dba21b633 100644 --- a/portfwd.go +++ b/portfwd.go @@ -35,12 +35,6 @@ logger.WithDefaultLevel(level).Printf("success: external port %v", externalPort) } func (cl *Client) forwardPort() { - cl.lock() - defer cl.unlock() - if cl.config.NoDefaultPortForwarding { - return - } - cl.unlock() ds := upnp.Discover(0, 2*time.Second, cl.logger.WithValues(UpnpDiscoverLogTag)) cl.lock() cl.logger.WithDefaultLevel(log.Debug).Printf("discovered %d upnp devices", len(ds)) @@ -51,7 +45,6 @@ for _, d := range ds { go cl.addPortMapping(d, upnp.TCP, port, id) go cl.addPortMapping(d, upnp.UDP, port, id) } - cl.lock() } func (cl *Client) deletePortMapping(d upnp.Device, proto upnp.Protocol, externalPort int) {