diff options
| author | Javier Cardona <javier@cozybit.com> | 2011-04-07 18:08:29 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2011-04-12 16:57:37 -0400 |
| commit | 5cff5e01e818029a5d2c3c31b7ae5e5e7ee70452 (patch) | |
| tree | 6031ce45cf4a1dd62d9f1237a225a0a8ce005cf0 | |
| parent | 15d5dda623139bbf6165030fc251bbd5798f4130 (diff) | |
mac80211: ignore peers if security is enabled for this mesh
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| -rw-r--r-- | net/mac80211/cfg.c | 1 | ||||
| -rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
| -rw-r--r-- | net/mac80211/mesh.c | 4 | ||||
| -rw-r--r-- | net/mac80211/mesh_plink.c | 4 | ||||
| -rw-r--r-- | net/wireless/mesh.c | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d9428afd8bf6..dc623d884d02 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -1053,6 +1053,7 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, | |||
| 1053 | memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len); | 1053 | memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len); |
| 1054 | ifmsh->mesh_pp_id = setup->path_sel_proto; | 1054 | ifmsh->mesh_pp_id = setup->path_sel_proto; |
| 1055 | ifmsh->mesh_pm_id = setup->path_metric; | 1055 | ifmsh->mesh_pm_id = setup->path_metric; |
| 1056 | ifmsh->is_secure = setup->is_secure; | ||
| 1056 | 1057 | ||
| 1057 | return 0; | 1058 | return 0; |
| 1058 | } | 1059 | } |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 6450100594ba..8d6d6e3d95da 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
| @@ -490,6 +490,7 @@ struct ieee80211_if_mesh { | |||
| 490 | bool accepting_plinks; | 490 | bool accepting_plinks; |
| 491 | const u8 *ie; | 491 | const u8 *ie; |
| 492 | u8 ie_len; | 492 | u8 ie_len; |
| 493 | bool is_secure; | ||
| 493 | }; | 494 | }; |
| 494 | 495 | ||
| 495 | #ifdef CONFIG_MAC80211_MESH | 496 | #ifdef CONFIG_MAC80211_MESH |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 1c244c0c7664..47a26c0f6993 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
| @@ -573,6 +573,10 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, | |||
| 573 | ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen, | 573 | ieee802_11_parse_elems(mgmt->u.probe_resp.variable, len - baselen, |
| 574 | &elems); | 574 | &elems); |
| 575 | 575 | ||
| 576 | /* ignore beacons from secure mesh peers if our security is off */ | ||
| 577 | if (elems.rsn_len && !sdata->u.mesh.is_secure) | ||
| 578 | return; | ||
| 579 | |||
| 576 | if (elems.ds_params && elems.ds_params_len == 1) | 580 | if (elems.ds_params && elems.ds_params_len == 1) |
| 577 | freq = ieee80211_channel_to_frequency(elems.ds_params[0], band); | 581 | freq = ieee80211_channel_to_frequency(elems.ds_params[0], band); |
| 578 | else | 582 | else |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index c705b20e1acb..bafe25594e09 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
| @@ -449,6 +449,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 449 | mpl_dbg("Mesh plink: missing necessary peer link ie\n"); | 449 | mpl_dbg("Mesh plink: missing necessary peer link ie\n"); |
| 450 | return; | 450 | return; |
| 451 | } | 451 | } |
| 452 | if (elems.rsn_len && !sdata->u.mesh.is_secure) { | ||
| 453 | mpl_dbg("Mesh plink: can't establish link with secure peer\n"); | ||
| 454 | return; | ||
| 455 | } | ||
| 452 | 456 | ||
| 453 | ftype = mgmt->u.action.u.plink_action.action_code; | 457 | ftype = mgmt->u.action.u.plink_action.action_code; |
| 454 | ie_len = elems.peer_link_len; | 458 | ie_len = elems.peer_link_len; |
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index 0e5c122ce324..e0226e8265a3 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
| @@ -55,6 +55,7 @@ const struct mesh_setup default_mesh_setup = { | |||
| 55 | .path_metric = IEEE80211_PATH_METRIC_AIRTIME, | 55 | .path_metric = IEEE80211_PATH_METRIC_AIRTIME, |
| 56 | .ie = NULL, | 56 | .ie = NULL, |
| 57 | .ie_len = 0, | 57 | .ie_len = 0, |
| 58 | .is_secure = false, | ||
| 58 | }; | 59 | }; |
| 59 | 60 | ||
| 60 | int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | 61 | int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, |
