From c51076361843950ac4ebed6770af25557ae3535c Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Tue, 1 Mar 2022 20:20:25 +0200 Subject: [PATCH] rfkill: fix the rfkill reason property query and parsing The udev property is RFKILL_HW_BLOCK_REASON and it is returned as a bitmap in hexadecimal. --- src/core/nm-rfkill-manager.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/nm-rfkill-manager.c b/src/core/nm-rfkill-manager.c index 2315973d85..9eac097294 100644 --- a/src/core/nm-rfkill-manager.c +++ b/src/core/nm-rfkill-manager.c @@ -211,9 +211,10 @@ recheck_killswitches(NMRfkillManager *self) G_MININT, G_MAXINT, -1); + sysfs_reason = _nm_utils_ascii_str_to_int64( - udev_device_get_property_value(device, "RFKILL_STATE_REASON"), - 10, + udev_device_get_property_value(device, "RFKILL_HW_BLOCK_REASON"), + 16, G_MININT, G_MAXINT, 1); /* defaults to SIGNAL in case the kernel does not support this */ -- GitLab