From 22b76f4c58ffe096296576665ca15abb98461d04 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 23 Feb 2018 14:52:05 +0100 Subject: [PATCH] libnm/device: prefer FROM_DATABASE udev properties The database has a chance to fix up over garbage strings from the device properties and we're now known to be reasonably good at fixing up crap there. --- libnm/nm-device.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 584dc363fc..6d24840b06 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -1350,15 +1350,14 @@ _get_udev_property (NMDevice *device, } udev_device_unref (udev_device); - /* Prefer the encoded value which comes directly from the device - * over the hwdata database value. - */ - if (enc_value) { - g_free (db_value); - return enc_value; + /* Prefer the hwdata database value over what comes directly + * from the device. */ + if (db_value) { + g_free (enc_value); + return db_value; } - return db_value; + return enc_value; } static char *