|
@@ -113,20 +113,20 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
|
|
struct ieee80211_sub_if_data *sdata)
|
|
struct ieee80211_sub_if_data *sdata)
|
|
{
|
|
{
|
|
struct ieee80211_local *local = sdata->local;
|
|
struct ieee80211_local *local = sdata->local;
|
|
- struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
|
|
|
|
|
|
+ struct sk_buff *skb;
|
|
struct ieee80211_mgmt *mgmt;
|
|
struct ieee80211_mgmt *mgmt;
|
|
- u8 *pos;
|
|
|
|
- int ie_len;
|
|
|
|
|
|
+ u8 *pos, ie_len;
|
|
|
|
+ int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.mesh_action) +
|
|
|
|
+ sizeof(mgmt->u.action.u.mesh_action);
|
|
|
|
|
|
|
|
+ skb = dev_alloc_skb(local->hw.extra_tx_headroom +
|
|
|
|
+ hdr_len +
|
|
|
|
+ 2 + 37); /* max HWMP IE */
|
|
if (!skb)
|
|
if (!skb)
|
|
return -1;
|
|
return -1;
|
|
skb_reserve(skb, local->hw.extra_tx_headroom);
|
|
skb_reserve(skb, local->hw.extra_tx_headroom);
|
|
- /* 25 is the size of the common mgmt part (24) plus the size of the
|
|
|
|
- * common action part (1)
|
|
|
|
- */
|
|
|
|
- mgmt = (struct ieee80211_mgmt *)
|
|
|
|
- skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action));
|
|
|
|
- memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action));
|
|
|
|
|
|
+ mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
|
|
|
|
+ memset(mgmt, 0, hdr_len);
|
|
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
|
|
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
|
|
IEEE80211_STYPE_ACTION);
|
|
IEEE80211_STYPE_ACTION);
|
|
|
|
|
|
@@ -240,20 +240,20 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn,
|
|
struct ieee80211_sub_if_data *sdata)
|
|
struct ieee80211_sub_if_data *sdata)
|
|
{
|
|
{
|
|
struct ieee80211_local *local = sdata->local;
|
|
struct ieee80211_local *local = sdata->local;
|
|
- struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400);
|
|
|
|
|
|
+ struct sk_buff *skb;
|
|
struct ieee80211_mgmt *mgmt;
|
|
struct ieee80211_mgmt *mgmt;
|
|
- u8 *pos;
|
|
|
|
- int ie_len;
|
|
|
|
|
|
+ u8 *pos, ie_len;
|
|
|
|
+ int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.mesh_action) +
|
|
|
|
+ sizeof(mgmt->u.action.u.mesh_action);
|
|
|
|
|
|
|
|
+ skb = dev_alloc_skb(local->hw.extra_tx_headroom +
|
|
|
|
+ hdr_len +
|
|
|
|
+ 2 + 15 /* PERR IE */);
|
|
if (!skb)
|
|
if (!skb)
|
|
return -1;
|
|
return -1;
|
|
skb_reserve(skb, local->tx_headroom + local->hw.extra_tx_headroom);
|
|
skb_reserve(skb, local->tx_headroom + local->hw.extra_tx_headroom);
|
|
- /* 25 is the size of the common mgmt part (24) plus the size of the
|
|
|
|
- * common action part (1)
|
|
|
|
- */
|
|
|
|
- mgmt = (struct ieee80211_mgmt *)
|
|
|
|
- skb_put(skb, 25 + sizeof(mgmt->u.action.u.mesh_action));
|
|
|
|
- memset(mgmt, 0, 25 + sizeof(mgmt->u.action.u.mesh_action));
|
|
|
|
|
|
+ mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
|
|
|
|
+ memset(mgmt, 0, hdr_len);
|
|
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
|
|
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
|
|
IEEE80211_STYPE_ACTION);
|
|
IEEE80211_STYPE_ACTION);
|
|
|
|
|