@@ -105,13 +105,18 @@ vector<InterfaceInfo> LinuxPlatform::interfaces()
105
105
else
106
106
continue ;
107
107
108
- /* Get parent physical device */
109
- string parent = device_get_property_string (context, devices[i] , " net.originating_device" , &error);
108
+ /* device points to a 'network inteface', get parent ( physical?) device */
109
+ string parent = device_get_property_string (context, device , " net.originating_device" , &error);
110
110
111
- /* Originating_device of USB interfaces is an interface, the parent of that is the actual device */
112
- string parent_subsystem = device_get_property_string (context, parent, " info.subsystem" , &error);
113
- if (parent_subsystem == " usb" )
114
- parent = device_get_property_string (context, parent, " info.parent" , &error);
111
+ if (parent != " /org/freedesktop/Hal/devices/computer" ) {
112
+ /* Might need to go up one more level to actually find physical device */
113
+ string parent_subsystem = device_get_property_string (context, parent, " info.subsystem" , &error);
114
+ if (parent_subsystem == " usb" )
115
+ parent = device_get_property_string (context, parent, " info.parent" , &error);
116
+ } else {
117
+ /* Some virtual network interfaces have no device parent. */
118
+ parent = devices[i];
119
+ }
115
120
116
121
/* Get device properties */
117
122
string vendor = device_get_property_string (context, parent, " info.vendor" , &error);
0 commit comments