All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iw 1/4] iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions
@ 2021-09-10 14:16 Gokul Sivakumar
  2021-09-10 14:16 ` [PATCH iw 2/4] iw: link: mention the need for MAC addr arg in link get_sta cmd usage menu Gokul Sivakumar
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Gokul Sivakumar @ 2021-09-10 14:16 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Gokul Sivakumar, linux-wireless

It is noticed in Kernel version 5.14.0-rc4+, that when sending the NL cmd
NL80211_CMD_SET_TID_CONFIG with nested attrs under NL80211_ATTR_TID_CONFIG,
kernel returnes a response with the error "NLA_F_NESTED is missing".

 $ sudo ./iw dev wlan0 set tidconf tids 0x1 ampdu on
 kernel reports: NLA_F_NESTED is missing
 command failed: Invalid argument (-22))

Fix this by setting NLA_F_NESTED flag everytime when using nla_nest_start()
library function. This is needed to make cfg80211 allow the nl80211 command
NL80211_ATTR_TID_CONFIG in the new kernel versions that enforce netlink
attribute policy validation.

Signed-off-by: Gokul Sivakumar <gokulkumar792@gmail.com>
---
 iw.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/iw.h b/iw.h
index a118f5b..545fd0e 100644
--- a/iw.h
+++ b/iw.h
@@ -11,6 +11,11 @@
 #include "nl80211.h"
 #include "ieee80211.h"
 
+#ifndef NL_CAPABILITY_VERSION_3_5_0
+#define nla_nest_start(msg, attrtype) \
+       nla_nest_start(msg, NLA_F_NESTED | (attrtype))
+#endif
+
 /* support for extack if compilation headers are too old */
 #ifndef NETLINK_EXT_ACK
 #define NETLINK_EXT_ACK 11
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-23 16:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 14:16 [PATCH iw 1/4] iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions Gokul Sivakumar
2021-09-10 14:16 ` [PATCH iw 2/4] iw: link: mention the need for MAC addr arg in link get_sta cmd usage menu Gokul Sivakumar
2021-09-10 14:16 ` [PATCH iw 3/4] iw: event: add the missing time display format in the "iw event" help menu Gokul Sivakumar
2021-09-10 14:16 ` [PATCH iw 4/4] iw: mesh: add comments in the mesh confguration parameter printing sections Gokul Sivakumar
2021-09-23 11:36 ` [PATCH iw 1/4] iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions Johannes Berg
2021-09-23 15:53   ` Gokul Sivakumar
2021-09-23 15:56     ` Johannes Berg
2021-09-23 16:23       ` Gokul Sivakumar
2021-09-23 16:25         ` Johannes Berg

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.