All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gokul Sivakumar <gokulkumar792@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Gokul Sivakumar <gokulkumar792@gmail.com>,
	linux-wireless@vger.kernel.org
Subject: [PATCH iw 1/4] iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions
Date: Fri, 10 Sep 2021 19:46:15 +0530	[thread overview]
Message-ID: <20210910141618.1594617-1-gokulkumar792@gmail.com> (raw)

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


             reply	other threads:[~2021-09-10 14:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 14:16 Gokul Sivakumar [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210910141618.1594617-1-gokulkumar792@gmail.com \
    --to=gokulkumar792@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.