fix(rfkill): accept events larger than v1 event size

Kernel 5.11 added one more field to the `struct rfkill_event` and broke
unnecessarily strict check in `rfkill.cpp`. According to `linux/rfkill.h`,
we must accept events at least as large as v1 event size and should be
prepared to get additional fields at the end of a v1 event structure.
This commit is contained in:
Aleksei Bavshin 2021-02-01 18:50:45 -08:00
parent c5f875dc5f
commit 40f4dc9ecf
No known key found for this signature in database
GPG Key ID: 4F071603387A382A
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ void waybar::util::Rfkill::waitForEvent() {
break;
}
if (len != RFKILL_EVENT_SIZE_V1) {
if (len < RFKILL_EVENT_SIZE_V1) {
throw std::runtime_error("Wrong size of RFKILL event");
continue;
}