mirror of
https://github.com/systemd/systemd.git
synced 2025-08-03 08:22:21 +03:00
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:
committed by
Tom Gundersen
parent
8c12bb073d
commit
285760fedf
@ -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",
|
||||
|
Reference in New Issue
Block a user