[fix][broker] filter the virtual NIC with relative path
@@ -227,10 +227,10 @@ public class LinuxBrokerHostUsageImpl implements BrokerHostUsage {
}
private boolean isPhysicalNic(Path path) {
- if (path.toString().contains("/virtual/")) {
+ try {
+ if (path.toRealPath().toString().contains("/virtual/")) {
return false;
}
- try {
// Check the type to make sure it's ethernet (type "1")
String type = new String(Files.readAllBytes(path.resolve("type")), StandardCharsets.UTF_8).trim();
// wireless NICs don't report speed, ignore them.
