From 10655d1bc24ab9297b677da73dff76b46f97d258 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 17 Feb 2020 17:25:05 +0200 Subject: [PATCH] nl80211: Add NLA_F_NESTED to nla_nest_start() with older libnl versions This is needed to work around a missing attribute that would cause cfg80211 to reject some nl80211 commands (e.g., NL80211_ATTR_VENDOR_DATA) with new kernel versions that enforce netlink attribute policy validation. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index e4d81b125..6e6c87247 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -17,6 +17,11 @@ #include "utils/list.h" #include "driver.h" +#ifndef NL_CAPABILITY_VERSION_3_5_0 +#define nla_nest_start(msg, attrtype) \ + nla_nest_start(msg, NLA_F_NESTED | (attrtype)) +#endif + struct nl80211_global { void *ctx; struct dl_list interfaces;