mirror of
https://github.com/safing/portmaster.git
synced 2026-05-20 20:40:36 +00:00
52a3b9256a
- Refactor GetInterface* functions to return InterfaceInfo with IPv4/IPv6
addresses instead of just net.Interface
- Add pre-caching of first routable IPv4/IPv6 per interface to avoid repeated
address list scans
- Skip loopback interfaces in cache refresh
- Add GetBestPhysicalDefaultInterfaces() to detect which physical adapters
carry the default route per IP family, excluding VPNs/tunnels
- Implement platform-specific physical interface detection:
* Linux: reads /proc/net/route and /proc/net/ipv6_route, uses
/sys/class/net/*/device to identify real hardware
* Windows: uses GetAdaptersAddresses with IfType filtering
* Other platforms: returns not-supported error
- Add helper functions: buildInterfaceInfo, interfaceToInfo, buildInterfaceInfoDirect,
hasRoutableIPv4, hasRoutableIPv6
- Update tests to work with new InterfaceInfo return type and add coverage
for new features
11 lines
274 B
Go
11 lines
274 B
Go
//go:build !linux && !windows
|
|
|
|
package netenv
|
|
|
|
import "net"
|
|
|
|
// selectPhysicalDefaultInterfaces is not implemented on this platform.
|
|
func selectPhysicalDefaultInterfaces() (*net.Interface, *net.Interface, error) {
|
|
return nil, nil, errNoPhysicalDefaultInterface
|
|
}
|