This file won't exist on kernels earlier than 3.17.
if (network->match_name) {
attr = udev_device_get_sysattr_value(device, "name_assign_type");
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",
if (name_assign_type == NET_NAME_ENUM)
log_warning("%-*s: found matching network '%s', based on potentially unstable ifname",