From 95a9df826d082c984de4f20907d8d40c94f881ce Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 1 Aug 2024 15:57:45 +0700 Subject: [PATCH] cmd/cli: extend list of valid interfaces for MacOS --- cmd/cli/net_darwin.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/cli/net_darwin.go b/cmd/cli/net_darwin.go index 37f8d7b..fdee1f8 100644 --- a/cmd/cli/net_darwin.go +++ b/cmd/cli/net_darwin.go @@ -43,18 +43,20 @@ func networkServiceName(ifaceName string, r io.Reader) string { return "" } -// validInterface reports whether the *net.Interface is a valid one, which includes: -// +// validInterface reports whether the *net.Interface is a valid one, which includes en0 -> en10. // - en0: physical wireless // - en1: Thunderbolt 1 // - en2: Thunderbolt 2 // - en3: Thunderbolt 3 // - en4: Thunderbolt 4 +// - ... +// - en10: iPad // // For full list, see: https://unix.stackexchange.com/questions/603506/what-are-these-ifconfig-interfaces-on-macos func validInterface(iface *net.Interface) bool { switch iface.Name { - case "en0", "en1", "en2", "en3", "en4": + case "en0", "en1", "en2", "en3", "en4", "en5", + "en6", "en7", "en8", "en9", "en10": return true default: return false