diff mbox series

[15/17] nl80211util: add key type/idx to nl80211_parse_attrs

Message ID 20221101201747.143379-15-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/17] wiphy: add wiphy_get_supported_ciphers | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Nov. 1, 2022, 8:17 p.m. UTC
---
 src/nl80211util.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Denis Kenzior Nov. 1, 2022, 8:56 p.m. UTC | #1
Hi James,

On 11/1/22 15:17, James Prestwood wrote:
> ---
>   src/nl80211util.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 

Patch 15 & 16 applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/nl80211util.c b/src/nl80211util.c
index 5ba0097f..da36d936 100644
--- a/src/nl80211util.c
+++ b/src/nl80211util.c
@@ -139,6 +139,17 @@  static bool extract_nested(const void *data, uint16_t len, void *o)
 	return true;
 }
 
+static bool extract_u8(const void *data, uint16_t len, void *o)
+{
+	uint8_t *out = o;
+
+	if (len != 1)
+		return false;
+
+	*out = l_get_u8(data);
+	return true;
+}
+
 static attr_handler handler_for_type(enum nl80211_attrs type)
 {
 	switch (type) {
@@ -146,6 +157,7 @@  static attr_handler handler_for_type(enum nl80211_attrs type)
 		return extract_ifindex;
 	case NL80211_ATTR_WIPHY:
 	case NL80211_ATTR_IFTYPE:
+	case NL80211_ATTR_KEY_TYPE:
 		return extract_uint32;
 	case NL80211_ATTR_WDEV:
 	case NL80211_ATTR_COOKIE:
@@ -170,6 +182,8 @@  static attr_handler handler_for_type(enum nl80211_attrs type)
 		return extract_iovec;
 	case NL80211_ATTR_WIPHY_BANDS:
 		return extract_nested;
+	case NL80211_ATTR_KEY_IDX:
+		return extract_u8;
 	default:
 		break;
 	}