key: add Nl80211KeyDefaultType and NL80211_KEY_DEFAULT_TYPES support#77
Conversation
Problem: The `Nl80211KeyAttr` enum was missing `NL80211_KEY_DEFAULT_TYPES` (kind 8), preventing users from marking a group key as the default multicast key via `NL80211_CMD_SET_KEY`. Fix: Add `Nl80211KeyDefaultType` enum mirroring kernel `enum nl80211_key_default_types` (`Unicast`, `Multicast`). Add `DefaultTypes(Vec<Nl80211KeyDefaultType>)` variant to `Nl80211KeyAttr` with full encode/decode support. Export the new type from the crate root. Existing round-trip tests in `tests/key.rs` continue to pass. Signed-off-by: Gris Ge <cnfourt@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request adds support for Extended RSN Capabilities (RSNXE, element ID 244) using a u128 bitflags representation to handle variable-length capability fields. It also introduces support for the NL80211_KEY_DEFAULT_TYPES key attribute and its nested Nl80211KeyDefaultType sub-attributes (Unicast and Multicast). A compilation issue was identified in src/key.rs where .context() is incorrectly called on NlaBuffer items yielded by NlasIterator during parsing.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Problem:
The
Nl80211KeyAttrenum was missingNL80211_KEY_DEFAULT_TYPES(kind 8),preventing users from marking a group key as the default multicast key via
NL80211_CMD_SET_KEY.Fix:
Add
Nl80211KeyDefaultTypeenum mirroring kernelenum nl80211_key_default_types(Unicast,Multicast).Add
DefaultTypes(Vec<Nl80211KeyDefaultType>)variant toNl80211KeyAttrwith full encode/decode support.
Export the new type from the crate root.
Existing round-trip tests in
tests/key.rscontinue to pass.