diff options
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r-- | net/mac80211/mesh.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 73ac607beb5d..6a381cbe1e33 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -1255,13 +1255,12 @@ int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, | |||
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, | 1257 | static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, |
1258 | struct ieee80211_mgmt *mgmt, size_t len) | 1258 | struct ieee80211_mgmt *mgmt, size_t len, |
1259 | struct ieee802_11_elems *elems) | ||
1259 | { | 1260 | { |
1260 | struct ieee80211_mgmt *mgmt_fwd; | 1261 | struct ieee80211_mgmt *mgmt_fwd; |
1261 | struct sk_buff *skb; | 1262 | struct sk_buff *skb; |
1262 | struct ieee80211_local *local = sdata->local; | 1263 | struct ieee80211_local *local = sdata->local; |
1263 | u8 *pos = mgmt->u.action.u.chan_switch.variable; | ||
1264 | size_t offset_ttl; | ||
1265 | 1264 | ||
1266 | skb = dev_alloc_skb(local->tx_headroom + len); | 1265 | skb = dev_alloc_skb(local->tx_headroom + len); |
1267 | if (!skb) | 1266 | if (!skb) |
@@ -1269,13 +1268,9 @@ static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
1269 | skb_reserve(skb, local->tx_headroom); | 1268 | skb_reserve(skb, local->tx_headroom); |
1270 | mgmt_fwd = skb_put(skb, len); | 1269 | mgmt_fwd = skb_put(skb, len); |
1271 | 1270 | ||
1272 | /* offset_ttl is based on whether the secondary channel | 1271 | elems->mesh_chansw_params_ie->mesh_ttl--; |
1273 | * offset is available or not. Subtract 1 from the mesh TTL | 1272 | elems->mesh_chansw_params_ie->mesh_flags &= |
1274 | * and disable the initiator flag before forwarding. | 1273 | ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR; |
1275 | */ | ||
1276 | offset_ttl = (len < 42) ? 7 : 10; | ||
1277 | *(pos + offset_ttl) -= 1; | ||
1278 | *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR; | ||
1279 | 1274 | ||
1280 | memcpy(mgmt_fwd, mgmt, len); | 1275 | memcpy(mgmt_fwd, mgmt, len); |
1281 | eth_broadcast_addr(mgmt_fwd->da); | 1276 | eth_broadcast_addr(mgmt_fwd->da); |
@@ -1323,7 +1318,7 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
1323 | 1318 | ||
1324 | /* forward or re-broadcast the CSA frame */ | 1319 | /* forward or re-broadcast the CSA frame */ |
1325 | if (fwd_csa) { | 1320 | if (fwd_csa) { |
1326 | if (mesh_fwd_csa_frame(sdata, mgmt, len) < 0) | 1321 | if (mesh_fwd_csa_frame(sdata, mgmt, len, &elems) < 0) |
1327 | mcsa_dbg(sdata, "Failed to forward the CSA frame"); | 1322 | mcsa_dbg(sdata, "Failed to forward the CSA frame"); |
1328 | } | 1323 | } |
1329 | } | 1324 | } |