Skip to content

key: add Nl80211KeyDefaultType and NL80211_KEY_DEFAULT_TYPES support#77

Merged
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main
Jun 20, 2026
Merged

key: add Nl80211KeyDefaultType and NL80211_KEY_DEFAULT_TYPES support#77
cathay4t merged 1 commit into
rust-netlink:mainfrom
cathay4t:main

Conversation

@cathay4t

Copy link
Copy Markdown
Member

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.

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>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/key.rs
@cathay4t
cathay4t merged commit 88e4747 into rust-netlink:main Jun 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant