fix(hidpp): tell another protocol's reports apart from malformed HID++ - #1373
Open
Chernicharo wants to merge 2 commits into
Open
fix(hidpp): tell another protocol's reports apart from malformed HID++#1373Chernicharo wants to merge 2 commits into
Chernicharo wants to merge 2 commits into
Conversation
A HID node can carry more than HID++: a Unifying receiver on Linux also emits Logitech DJ reports (0x20/0x21) on the node HID++ uses. The read loop classified every non-HID++ report as MalformedIncomingReport, so the fixture recorder rejected each cassette recorded on such a receiver and `fixture contribute` could never complete there. Report a non-HID++ report ID as ForeignIncomingReport instead, keep MalformedIncomingReport for HID++ report IDs that fail parsing, and let the cassette builder ignore foreign traffic. Foreign reports never entered a cassette, so replay and privacy guarantees are unchanged. Fixes AprilNEA#1349
This was referenced Sep 12, 2026
|
The regression only asserted that MalformedIncomingReport was absent, so misclassifying a DJ report as unmatched HID++ input would still have passed. Record a committable exchange alongside the foreign report and assert the whole rejection set instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1349:
openlogi fixture contributestep 2 can never succeed for a Unifying receiver on Linux, because the receiver's node also carries Logitech DJ reports (0x20/0x21) and every one of them was classified as a malformed HID++ report, which rejects the whole cassette.The channel conflated two different facts: a report carrying a HID++ report ID whose framing is invalid, and a report belonging to another protocol that shares the node. Only the first is malformed HID++. The channel already drops both, so replay never needed the foreign ones.
Changes
openlogi-hidpp: addis_hidpp_report_id, and aChannelObservation::ForeignIncomingReportvariant. The read loop now reports a non-HID++ report ID as foreign traffic and keepsMalformedIncomingReportfor HID++ IDs that fail parsing. A zero-length read stays malformed.openlogi-hid:unassociated_rejectionreturnsOption<CassetteRejectionReason>and yieldsNonefor foreign reports; the cassette builder skips those. Foreign reports never entered the cassette itself, so this changes no privacy or replay guarantee.Testing
cargo test -p openlogi-hidpp/cargo test -p openlogi-hid— 212 and 40 passed. Full tier on Linux x86_64 as well:cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace --exclude openlogi-desktop --no-fail-fast(1404 passed), and the non-GUI rustdoc gate — all green. macOS/Windows cross-lints not run.cargo clippy -p openlogi-hidpp -p openlogi-hid --all-targets -- -D warningscargo fmt --all -- --checkis_hidpp_report_idrejects the DJ report IDs; a wire-captured DJ "device paired" notification no longer rejects a cassette, while the existing malformed-HID++ rejection test still passes.hid-logitech-djbound),openlogi fixture contributestep 2 now records all eight cassettes and passes strict verification. The same command rejected every attempt (4/4) before this change.Fixes #1349