aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r--net/mac80211/mesh.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index bbd56b087899..51adb1115215 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -16,12 +16,6 @@
16#define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ) 16#define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ)
17#define IEEE80211_MESH_RANN_INTERVAL (1 * HZ) 17#define IEEE80211_MESH_RANN_INTERVAL (1 * HZ)
18 18
19#define MESHCONF_PP_OFFSET 0 /* Path Selection Protocol */
20#define MESHCONF_PM_OFFSET 1 /* Path Selection Metric */
21#define MESHCONF_CC_OFFSET 2 /* Congestion Control Mode */
22#define MESHCONF_SP_OFFSET 3 /* Synchronization Protocol */
23#define MESHCONF_AUTH_OFFSET 4 /* Authentication Protocol */
24#define MESHCONF_CAPAB_OFFSET 6
25#define MESHCONF_CAPAB_ACCEPT_PLINKS 0x01 19#define MESHCONF_CAPAB_ACCEPT_PLINKS 0x01
26#define MESHCONF_CAPAB_FORWARDING 0x08 20#define MESHCONF_CAPAB_FORWARDING 0x08
27 21
@@ -87,12 +81,11 @@ bool mesh_matches_local(struct ieee802_11_elems *ie, struct ieee80211_sub_if_dat
87 */ 81 */
88 if (ifmsh->mesh_id_len == ie->mesh_id_len && 82 if (ifmsh->mesh_id_len == ie->mesh_id_len &&
89 memcmp(ifmsh->mesh_id, ie->mesh_id, ie->mesh_id_len) == 0 && 83 memcmp(ifmsh->mesh_id, ie->mesh_id, ie->mesh_id_len) == 0 &&
90 (ifmsh->mesh_pp_id == *(ie->mesh_config + MESHCONF_PP_OFFSET))&& 84 (ifmsh->mesh_pp_id == ie->mesh_config->meshconf_psel) &&
91 (ifmsh->mesh_pm_id == *(ie->mesh_config + MESHCONF_PM_OFFSET))&& 85 (ifmsh->mesh_pm_id == ie->mesh_config->meshconf_pmetric) &&
92 (ifmsh->mesh_cc_id == *(ie->mesh_config + MESHCONF_CC_OFFSET))&& 86 (ifmsh->mesh_cc_id == ie->mesh_config->meshconf_congest) &&
93 (ifmsh->mesh_sp_id == *(ie->mesh_config + MESHCONF_SP_OFFSET))&& 87 (ifmsh->mesh_sp_id == ie->mesh_config->meshconf_synch) &&
94 (ifmsh->mesh_auth_id == *(ie->mesh_config + 88 (ifmsh->mesh_auth_id == ie->mesh_config->meshconf_auth))
95 MESHCONF_AUTH_OFFSET)))
96 return true; 89 return true;
97 90
98 return false; 91 return false;
@@ -105,7 +98,7 @@ bool mesh_matches_local(struct ieee802_11_elems *ie, struct ieee80211_sub_if_dat
105 */ 98 */
106bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie) 99bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie)
107{ 100{
108 return (*(ie->mesh_config + MESHCONF_CAPAB_OFFSET) & 101 return (ie->mesh_config->meshconf_cap &
109 MESHCONF_CAPAB_ACCEPT_PLINKS) != 0; 102 MESHCONF_CAPAB_ACCEPT_PLINKS) != 0;
110} 103}
111 104
@@ -262,9 +255,9 @@ void mesh_mgmt_ies_add(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
262 if (sdata->u.mesh.mesh_id_len) 255 if (sdata->u.mesh.mesh_id_len)
263 memcpy(pos, sdata->u.mesh.mesh_id, sdata->u.mesh.mesh_id_len); 256 memcpy(pos, sdata->u.mesh.mesh_id, sdata->u.mesh.mesh_id_len);
264 257
265 pos = skb_put(skb, 2 + IEEE80211_MESH_CONFIG_LEN); 258 pos = skb_put(skb, 2 + sizeof(struct ieee80211_meshconf_ie));
266 *pos++ = WLAN_EID_MESH_CONFIG; 259 *pos++ = WLAN_EID_MESH_CONFIG;
267 *pos++ = IEEE80211_MESH_CONFIG_LEN; 260 *pos++ = sizeof(struct ieee80211_meshconf_ie);
268 261
269 /* Active path selection protocol ID */ 262 /* Active path selection protocol ID */
270 *pos++ = sdata->u.mesh.mesh_pp_id; 263 *pos++ = sdata->u.mesh.mesh_pp_id;
@@ -394,8 +387,9 @@ void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh)
394 * 387 *
395 * Return the length of the 802.11 (does not include a mesh control header) 388 * Return the length of the 802.11 (does not include a mesh control header)
396 */ 389 */
397int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc, char 390int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
398 *meshda, char *meshsa) { 391 const u8 *meshda, const u8 *meshsa)
392{
399 if (is_multicast_ether_addr(meshda)) { 393 if (is_multicast_ether_addr(meshda)) {
400 *fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS); 394 *fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
401 /* DA TA SA */ 395 /* DA TA SA */