fix(connlib): also read device_uuid for PC systems (#6921)

Addresses the comment here:
https://github.com/firezone/firezone/pull/6857#issuecomment-2390457560
This commit is contained in:
Jamil
2024-10-02 21:37:33 -07:00
committed by GitHub
parent a83bf8dfca
commit a95a2a2760

View File

@@ -36,9 +36,18 @@ fn device_serial() -> Option<String> {
Some(serial)
}
fn device_uuid() -> Option<String> {
let data = smbioslib::table_load_from_device().ok()?;
let uuid = data.find_map(|sys_info: smbioslib::SMBiosSystemInformation| sys_info.uuid());
uuid?.to_string().into()
}
pub fn device_info() -> phoenix_channel::DeviceInfo {
phoenix_channel::DeviceInfo {
device_serial: device_serial(),
device_uuid: device_uuid(),
..Default::default()
}
}