|
@@ -2227,6 +2227,7 @@ static const struct nla_policy mntr_flags_policy[NL80211_MNTR_FLAG_MAX + 1] = {
|
|
|
[NL80211_MNTR_FLAG_CONTROL] = { .type = NLA_FLAG },
|
|
|
[NL80211_MNTR_FLAG_OTHER_BSS] = { .type = NLA_FLAG },
|
|
|
[NL80211_MNTR_FLAG_COOK_FRAMES] = { .type = NLA_FLAG },
|
|
|
+ [NL80211_MNTR_FLAG_ACTIVE] = { .type = NLA_FLAG },
|
|
|
};
|
|
|
|
|
|
static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)
|
|
@@ -2338,6 +2339,10 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
|
|
|
change = true;
|
|
|
}
|
|
|
|
|
|
+ if (flags && (*flags & NL80211_MNTR_FLAG_ACTIVE) &&
|
|
|
+ !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
|
|
|
+ return -EOPNOTSUPP;
|
|
|
+
|
|
|
if (change)
|
|
|
err = cfg80211_change_iface(rdev, dev, ntype, flags, ¶ms);
|
|
|
else
|
|
@@ -2395,6 +2400,11 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
|
|
|
err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ?
|
|
|
info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL,
|
|
|
&flags);
|
|
|
+
|
|
|
+ if (!err && (flags & NL80211_MNTR_FLAG_ACTIVE) &&
|
|
|
+ !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
|
|
|
+ return -EOPNOTSUPP;
|
|
|
+
|
|
|
wdev = rdev_add_virtual_intf(rdev,
|
|
|
nla_data(info->attrs[NL80211_ATTR_IFNAME]),
|
|
|
type, err ? NULL : &flags, ¶ms);
|