Android support for getting network addresses and interfaces (#1056)

* Replace unsupported network functions for android

* Refactor default/android net addresses processing

* Add default connection values, Refactor netenv

* Fix compilation error

* Combine network change default/android functions
This commit is contained in:
Vladimir Stoilov
2023-01-23 16:33:02 +01:00
committed by GitHub
parent bd0314ee9e
commit 6972059321
5 changed files with 106 additions and 4 deletions

View File

@@ -5,7 +5,6 @@ import (
"context"
"crypto/sha1"
"io"
"net"
"time"
"github.com/safing/portbase/log"
@@ -61,7 +60,7 @@ serviceLoop:
// check network for changes
// create hashsum of current network config
hasher := sha1.New() //nolint:gosec // not used for security
interfaces, err := net.Interfaces()
interfaces, err := osGetNetworkInterfaces()
if err != nil {
log.Warningf("netenv: failed to get interfaces: %s", err)
continue