summaryrefslogtreecommitdiff
path: root/src/network/networkd-network.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-12-06 13:34:27 -0500
committerTom Gundersen <teg@jklm.no>2014-12-08 18:38:55 +0100
commit285760fedfaf907deab967b4b071d20e146752b5 (patch)
treef5eaffc58ea6bbf270ba204bf77ed8e342551b0c /src/network/networkd-network.c
parent8c12bb073d43b0e985cc2ced0650950ea59113c9 (diff)
Check return value from reading name_assign_type attr
This file won't exist on kernels earlier than 3.17.
Diffstat (limited to 'src/network/networkd-network.c')
-rw-r--r--src/network/networkd-network.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index bbc6475df0..75cc7d2f7b 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -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",