nl80211: explicit userspace MPM
Secure mesh had the implicit requirement that the Mesh Peering Management entity be in userspace. However userspace might want to implement an open MPM as well, so specify a mesh setup parameter to indicate this. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:

committed by
Johannes Berg

parent
2ff2b690c5
commit
bb2798d45f
@@ -85,6 +85,7 @@ const struct mesh_setup default_mesh_setup = {
|
||||
.ie = NULL,
|
||||
.ie_len = 0,
|
||||
.is_secure = false,
|
||||
.user_mpm = false,
|
||||
.beacon_interval = MESH_DEFAULT_BEACON_INTERVAL,
|
||||
.dtim_period = MESH_DEFAULT_DTIM_PERIOD,
|
||||
};
|
||||
|
@@ -4618,6 +4618,7 @@ static const struct nla_policy
|
||||
[NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL] = { .type = NLA_U8 },
|
||||
[NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC] = { .type = NLA_U8 },
|
||||
[NL80211_MESH_SETUP_USERSPACE_AUTH] = { .type = NLA_FLAG },
|
||||
[NL80211_MESH_SETUP_USERSPACE_MPM] = { .type = NLA_FLAG },
|
||||
[NL80211_MESH_SETUP_IE] = { .type = NLA_BINARY,
|
||||
.len = IEEE80211_MAX_DATA_LEN },
|
||||
[NL80211_MESH_SETUP_USERSPACE_AMPE] = { .type = NLA_FLAG },
|
||||
@@ -4756,6 +4757,7 @@ do { \
|
||||
static int nl80211_parse_mesh_setup(struct genl_info *info,
|
||||
struct mesh_setup *setup)
|
||||
{
|
||||
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
||||
struct nlattr *tb[NL80211_MESH_SETUP_ATTR_MAX + 1];
|
||||
|
||||
if (!info->attrs[NL80211_ATTR_MESH_SETUP])
|
||||
@@ -4792,8 +4794,14 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
|
||||
setup->ie = nla_data(ieattr);
|
||||
setup->ie_len = nla_len(ieattr);
|
||||
}
|
||||
if (tb[NL80211_MESH_SETUP_USERSPACE_MPM] &&
|
||||
!(rdev->wiphy.features & NL80211_FEATURE_USERSPACE_MPM))
|
||||
return -EINVAL;
|
||||
setup->user_mpm = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_MPM]);
|
||||
setup->is_authenticated = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_AUTH]);
|
||||
setup->is_secure = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_AMPE]);
|
||||
if (setup->is_secure)
|
||||
setup->user_mpm = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user