// isPhysicalIface checks if an interface is a physical device.
// We use ethtool here to not rely on device sysfs inside the network namespace.
isPhysicalIface checks if an interface is a physical device.
We use ethtool here to not rely on device sysfs inside the network namespace.
// isPhysicalIface checks if an interface is a physical device . // We use ethtool here to not rely on device sysfs inside the network namespace .
func isPhysicalIface(ifaceName string) (bool, error) {
	if ifaceName == "lo" {
		return false, nil
	}
	ethHandle, err := ethtool.NewEthtool()
	if err != nil {
		return false, err
	}
	defer ethHandle.Close()
	bus, err := ethHandle.BusInfo(ifaceName)
	if err != nil {
		return false, nil
	}
	tokens := strings.Split(bus, ":")
	if len(tokens) != 3 {
		return false, nil
	}
	return true, nil
}
func isPhysicalIface ( ifaceName string ) ( bool , error ) { if ifaceName == " " { return false , nil } ethHandle , err := ethtool . NewEthtool ( ) if err != nil { return false , err } defer ethHandle . Close ( ) bus , err := ethHandle . BusInfo ( ifaceName ) if err != nil { return false , nil } tokens := strings . Split ( bus , " " ) if len ( tokens ) != 3 { return false , nil } return true , nil }
isPhysicalIface checks if an interface is a physical device.
isPhysicalIface checks if an interface is a physical device .
// Check for a pci bus format