]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mac80211: ignore peers if security is enabled for this mesh
authorJavier Cardona <javier@cozybit.com>
Thu, 7 Apr 2011 22:08:29 +0000 (15:08 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 12 Apr 2011 20:57:37 +0000 (16:57 -0400)
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/mesh.c
net/mac80211/mesh_plink.c
net/wireless/mesh.c

index d9428afd8bf6d324a3f3cfd5d1e4343b97f83433..dc623d884d0233dc454bd0ea64563f3d4aa8ac33 100644 (file)
@@ -1053,6 +1053,7 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
        memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len);
        ifmsh->mesh_pp_id = setup->path_sel_proto;
        ifmsh->mesh_pm_id = setup->path_metric;
+       ifmsh->is_secure = setup->is_secure;
 
        return 0;
 }
index 6450100594bacce7813a766c58864c649c8de64b..8d6d6e3d95da409e6c72f286338411e38d548893 100644 (file)
@@ -490,6 +490,7 @@ struct ieee80211_if_mesh {
        bool accepting_plinks;
        const u8 *ie;
        u8 ie_len;
+       bool is_secure;
 };
 
 #ifdef CONFIG_MAC80211_MESH
index 1c244c0c76640870a898018ca1a26b38de397c7b..47a26c0f6993f573d1c368669404674a93c841ec 100644 (file)
@@ -573,6 +573,10 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
        ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen,
                               &elems);
 
+       /* ignore beacons from secure mesh peers if our security is off */
+       if (elems.rsn_len && !sdata->u.mesh.is_secure)
+               return;
+
        if (elems.ds_params && elems.ds_params_len == 1)
                freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
        else
index c705b20e1acbc507d0e914d2793ea4c2de15c40e..bafe25594e0913a9be2b3a1d6b76c94c33b08a30 100644 (file)
@@ -449,6 +449,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
                mpl_dbg("Mesh plink: missing necessary peer link ie\n");
                return;
        }
+       if (elems.rsn_len && !sdata->u.mesh.is_secure) {
+               mpl_dbg("Mesh plink: can't establish link with secure peer\n");
+               return;
+       }
 
        ftype = mgmt->u.action.u.plink_action.action_code;
        ie_len = elems.peer_link_len;
index 0e5c122ce32445236efa490d7ae5eef5425aa351..e0226e8265a3f2995c7f529fe7e2b8e897d235ad 100644 (file)
@@ -55,6 +55,7 @@ const struct mesh_setup default_mesh_setup = {
        .path_metric = IEEE80211_PATH_METRIC_AIRTIME,
        .ie = NULL,
        .ie_len = 0,
+       .is_secure = false,
 };
 
 int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,