Check return value from reading name_assign_type attr

This file won't exist on kernels earlier than 3.17.
This commit is contained in:
Dave Reisner
2014-12-08 18:38:55 +01:00
committed by Tom Gundersen
parent 8c12bb073d
commit 285760fedf
+2 -1
View File
@@ -231,7 +231,8 @@ int network_get(Manager *manager, struct udev_device *device,
if (network->match_name) {
attr = udev_device_get_sysattr_value(device, "name_assign_type");
(void)safe_atou8(attr, &name_assign_type);
if (attr)
(void)safe_atou8(attr, &name_assign_type);
if (name_assign_type == NET_NAME_ENUM)
log_warning("%-*s: found matching network '%s', based on potentially unstable ifname",