All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 09/12] nl80211util: set multicast on new group keys
@ 2021-10-04 16:48 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2021-10-04 16:48 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

This may not be required, but when working with extended key IDs
setting the key mode makes each NEW_KEY explicit whether or not
its the GTK or PTK key.
---
 src/nl80211util.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/nl80211util.c b/src/nl80211util.c
index d9d4819d..d663c6dc 100644
--- a/src/nl80211util.c
+++ b/src/nl80211util.c
@@ -247,6 +247,7 @@ struct l_genl_msg *nl80211_build_new_key_group(uint32_t ifindex, uint32_t cipher
 					size_t ctr_len, const uint8_t *addr)
 {
 	struct l_genl_msg *msg;
+	uint32_t type = NL80211_KEYTYPE_GROUP;
 
 	msg = l_genl_msg_new_sized(NL80211_CMD_NEW_KEY, 512);
 
@@ -263,16 +264,11 @@ struct l_genl_msg *nl80211_build_new_key_group(uint32_t ifindex, uint32_t cipher
 	if (ctr)
 		l_genl_msg_append_attr(msg, NL80211_KEY_SEQ, ctr_len, ctr);
 
-	if (addr) {
-		uint32_t type = NL80211_KEYTYPE_GROUP;
-
-		l_genl_msg_append_attr(msg, NL80211_KEY_TYPE, 4, &type);
-		l_genl_msg_enter_nested(msg, NL80211_KEY_DEFAULT_TYPES);
-		l_genl_msg_append_attr(msg, NL80211_KEY_DEFAULT_TYPE_MULTICAST,
+	l_genl_msg_append_attr(msg, NL80211_KEY_TYPE, 4, &type);
+	l_genl_msg_enter_nested(msg, NL80211_KEY_DEFAULT_TYPES);
+	l_genl_msg_append_attr(msg, NL80211_KEY_DEFAULT_TYPE_MULTICAST,
 					0, NULL);
-		l_genl_msg_leave_nested(msg);
-	}
-
+	l_genl_msg_leave_nested(msg);
 	l_genl_msg_leave_nested(msg);
 
 	return msg;
-- 
2.31.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-04 16:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 16:48 [PATCH 09/12] nl80211util: set multicast on new group keys James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.