]> git.ipfire.org Git - thirdparty/iw.git/commit - iw.h
iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions
authorGokul Sivakumar <gokulkumar792@gmail.com>
Fri, 10 Sep 2021 14:16:15 +0000 (19:46 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Sep 2021 11:11:05 +0000 (13:11 +0200)
commit50918cbb8e52ecae014f62617c8c342be960351b
tree4dd2a06305df433cacf00b4a604e6480e6eb036d
parent5a291261e4a39216cc2228ef8f8d655d19651a18
iw: nl80211: add NLA_F_NESTED to nla_nest_start() with older libnl versions

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>
Link: https://lore.kernel.org/r/20210910141618.1594617-1-gokulkumar792@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw.h