aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColleen Twitty <colleen@cozybit.com>2013-05-08 14:45:59 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-05-16 16:39:43 -0400
commit6e16d90b5218307db805e6b3e0b06d3946eb8c4c (patch)
treebbd37b170d3657f7df53475f8f9d4d6f73b7260e
parent7ade7036043e2e8e2831ae189ce5c248386062f1 (diff)
cfg80211: Userspace may inform kernel of mesh auth method.
Authentication takes place in userspace, but the beacon is generated in the kernel. Allow userspace to inform the kernel of the authentication method so the appropriate mesh config IE can be set prior to beacon generation when joining the MBSS. Signed-off-by: Colleen Twitty <colleen@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--include/uapi/linux/nl80211.h5
-rw-r--r--net/wireless/mesh.c1
-rw-r--r--net/wireless/nl80211.c8
4 files changed, 16 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 26e91138a2c6..32a2f1b20861 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1161,6 +1161,7 @@ struct mesh_config {
1161 * @sync_method: which synchronization method to use 1161 * @sync_method: which synchronization method to use
1162 * @path_sel_proto: which path selection protocol to use 1162 * @path_sel_proto: which path selection protocol to use
1163 * @path_metric: which metric to use 1163 * @path_metric: which metric to use
1164 * @auth_id: which authentication method this mesh is using
1164 * @ie: vendor information elements (optional) 1165 * @ie: vendor information elements (optional)
1165 * @ie_len: length of vendor information elements 1166 * @ie_len: length of vendor information elements
1166 * @is_authenticated: this mesh requires authentication 1167 * @is_authenticated: this mesh requires authentication
@@ -1179,6 +1180,7 @@ struct mesh_setup {
1179 u8 sync_method; 1180 u8 sync_method;
1180 u8 path_sel_proto; 1181 u8 path_sel_proto;
1181 u8 path_metric; 1182 u8 path_metric;
1183 u8 auth_id;
1182 const u8 *ie; 1184 const u8 *ie;
1183 u8 ie_len; 1185 u8 ie_len;
1184 bool is_authenticated; 1186 bool is_authenticated;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index b48430769eda..06320713e9c9 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2645,6 +2645,10 @@ enum nl80211_meshconf_params {
2645 * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will 2645 * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
2646 * implement an MPM which handles peer allocation and state. 2646 * implement an MPM which handles peer allocation and state.
2647 * 2647 *
2648 * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
2649 * method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
2650 * Default is no authentication method required.
2651 *
2648 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number 2652 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2649 * 2653 *
2650 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 2654 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
@@ -2658,6 +2662,7 @@ enum nl80211_mesh_setup_params {
2658 NL80211_MESH_SETUP_USERSPACE_AMPE, 2662 NL80211_MESH_SETUP_USERSPACE_AMPE,
2659 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, 2663 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
2660 NL80211_MESH_SETUP_USERSPACE_MPM, 2664 NL80211_MESH_SETUP_USERSPACE_MPM,
2665 NL80211_MESH_SETUP_AUTH_PROTOCOL,
2661 2666
2662 /* keep last */ 2667 /* keep last */
2663 __NL80211_MESH_SETUP_ATTR_AFTER_LAST, 2668 __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 0bb93f3061a4..9546ad210550 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -82,6 +82,7 @@ const struct mesh_setup default_mesh_setup = {
82 .sync_method = IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET, 82 .sync_method = IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET,
83 .path_sel_proto = IEEE80211_PATH_PROTOCOL_HWMP, 83 .path_sel_proto = IEEE80211_PATH_PROTOCOL_HWMP,
84 .path_metric = IEEE80211_PATH_METRIC_AIRTIME, 84 .path_metric = IEEE80211_PATH_METRIC_AIRTIME,
85 .auth_id = 0, /* open */
85 .ie = NULL, 86 .ie = NULL,
86 .ie_len = 0, 87 .ie_len = 0,
87 .is_secure = false, 88 .is_secure = false,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 9cdcd9ec3317..5f10f7acfa06 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4672,6 +4672,7 @@ static const struct nla_policy
4672 [NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL] = { .type = NLA_U8 }, 4672 [NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL] = { .type = NLA_U8 },
4673 [NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC] = { .type = NLA_U8 }, 4673 [NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC] = { .type = NLA_U8 },
4674 [NL80211_MESH_SETUP_USERSPACE_AUTH] = { .type = NLA_FLAG }, 4674 [NL80211_MESH_SETUP_USERSPACE_AUTH] = { .type = NLA_FLAG },
4675 [NL80211_MESH_SETUP_AUTH_PROTOCOL] = { .type = NLA_U8 },
4675 [NL80211_MESH_SETUP_USERSPACE_MPM] = { .type = NLA_FLAG }, 4676 [NL80211_MESH_SETUP_USERSPACE_MPM] = { .type = NLA_FLAG },
4676 [NL80211_MESH_SETUP_IE] = { .type = NLA_BINARY, 4677 [NL80211_MESH_SETUP_IE] = { .type = NLA_BINARY,
4677 .len = IEEE80211_MAX_DATA_LEN }, 4678 .len = IEEE80211_MAX_DATA_LEN },
@@ -4857,6 +4858,13 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
4857 if (setup->is_secure) 4858 if (setup->is_secure)
4858 setup->user_mpm = true; 4859 setup->user_mpm = true;
4859 4860
4861 if (tb[NL80211_MESH_SETUP_AUTH_PROTOCOL]) {
4862 if (!setup->user_mpm)
4863 return -EINVAL;
4864 setup->auth_id =
4865 nla_get_u8(tb[NL80211_MESH_SETUP_AUTH_PROTOCOL]);
4866 }
4867
4860 return 0; 4868 return 0;
4861} 4869}
4862 4870