cfg80211: Userspace may inform kernel of mesh auth method.
authorColleen Twitty <colleen@cozybit.com>
Wed, 8 May 2013 18:45:59 +0000 (11:45 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 16 May 2013 20:39:43 +0000 (22:39 +0200)
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>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/mesh.c
net/wireless/nl80211.c

index 26e91138a2c626f5b00f8976686fb8ac96231919..32a2f1b20861c52de2d17446e4588646a127fc83 100644 (file)
@@ -1161,6 +1161,7 @@ struct mesh_config {
  * @sync_method: which synchronization method to use
  * @path_sel_proto: which path selection protocol to use
  * @path_metric: which metric to use
+ * @auth_id: which authentication method this mesh is using
  * @ie: vendor information elements (optional)
  * @ie_len: length of vendor information elements
  * @is_authenticated: this mesh requires authentication
@@ -1179,6 +1180,7 @@ struct mesh_setup {
        u8 sync_method;
        u8 path_sel_proto;
        u8 path_metric;
+       u8 auth_id;
        const u8 *ie;
        u8 ie_len;
        bool is_authenticated;
index b48430769eda91046164d76868a147f308faa927..06320713e9c9c0412b8d907770823f4da408d544 100644 (file)
@@ -2645,6 +2645,10 @@ enum nl80211_meshconf_params {
  * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
  *     implement an MPM which handles peer allocation and state.
  *
+ * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
+ *     method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
+ *     Default is no authentication method required.
+ *
  * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
  *
  * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
@@ -2658,6 +2662,7 @@ enum nl80211_mesh_setup_params {
        NL80211_MESH_SETUP_USERSPACE_AMPE,
        NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
        NL80211_MESH_SETUP_USERSPACE_MPM,
+       NL80211_MESH_SETUP_AUTH_PROTOCOL,
 
        /* keep last */
        __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
index 0bb93f3061a4353db1da049a384aa0cd2f9d10ab..9546ad2105507f17d0743e49f8ecbee9c3129b31 100644 (file)
@@ -82,6 +82,7 @@ const struct mesh_setup default_mesh_setup = {
        .sync_method = IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET,
        .path_sel_proto = IEEE80211_PATH_PROTOCOL_HWMP,
        .path_metric = IEEE80211_PATH_METRIC_AIRTIME,
+       .auth_id = 0, /* open */
        .ie = NULL,
        .ie_len = 0,
        .is_secure = false,
index 9cdcd9ec33171ae0714b32aabe69e0dd3c455631..5f10f7acfa060c47f5d626e979267f87c7bf6435 100644 (file)
@@ -4672,6 +4672,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_AUTH_PROTOCOL] = { .type = NLA_U8 },
        [NL80211_MESH_SETUP_USERSPACE_MPM] = { .type = NLA_FLAG },
        [NL80211_MESH_SETUP_IE] = { .type = NLA_BINARY,
                                    .len = IEEE80211_MAX_DATA_LEN },
@@ -4857,6 +4858,13 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
        if (setup->is_secure)
                setup->user_mpm = true;
 
+       if (tb[NL80211_MESH_SETUP_AUTH_PROTOCOL]) {
+               if (!setup->user_mpm)
+                       return -EINVAL;
+               setup->auth_id =
+                       nla_get_u8(tb[NL80211_MESH_SETUP_AUTH_PROTOCOL]);
+       }
+
        return 0;
 }