diff --git a/connection/connection.go b/connection/connection.go index d64131384a2..7a95c766dd5 100644 --- a/connection/connection.go +++ b/connection/connection.go @@ -154,6 +154,9 @@ func (conn *Connection) Open(timeout time.Duration) error { if pair.Local.Type() == ice.CandidateTypeHost && pair.Remote.Type() == ice.CandidateTypeHost { log.Debugf("remote peer %s is in the local network with an address %s", conn.Config.RemoteWgKey.String(), pair.Remote.Address()) err = conn.wgProxy.StartLocal(fmt.Sprintf("%s:%d", pair.Remote.Address(), iface.WgPort)) + if err != nil { + return err + } } else { err = conn.wgProxy.Start(remoteConn) if err != nil { diff --git a/iface/mod.go b/iface/mod.go index f020c3e13f3..dd3239daee6 100644 --- a/iface/mod.go +++ b/iface/mod.go @@ -83,6 +83,12 @@ func elfMap(root string) (map[string]string, error) { err := filepath.Walk( root, func(path string, info os.FileInfo, err error) error { + + if err != nil { + // skip broken files + return nil + } + if !info.Mode().IsRegular() { return nil } @@ -118,11 +124,7 @@ func generateMap() (map[string]string, error) { // WireguardModExists returns true if Wireguard kernel module exists. func WireguardModExists() bool { _, err := resolveModName("wireguard") - if err != nil { - return false - } - - return true + return err == nil } // resolveModName will, given a module name (such as `wireguard`) return an absolute