Skip to content

Commit 15e230a

Browse files
realtwojmberg-intel
authored andcommitted
mac80211: use exact-size allocation for authentication frame
The authentication frame has a fixied size of 30 bytes (including header, algo num, trans seq num, and status) followed by a variable challenge text. Allocate using exact size, instead of over-allocation by sizeof(ieee80211_mgmt). Signed-off-by: Fred Zhou <fred.zy@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f082347 commit 15e230a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/mac80211/util.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,8 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
10811081
struct ieee80211_mgmt *mgmt;
10821082
int err;
10831083

1084-
skb = dev_alloc_skb(local->hw.extra_tx_headroom +
1085-
sizeof(*mgmt) + 6 + extra_len);
1084+
/* 24 + 6 = header + auth_algo + auth_transaction + status_code */
1085+
skb = dev_alloc_skb(local->hw.extra_tx_headroom + 24 + 6 + extra_len);
10861086
if (!skb)
10871087
return;
10881088

0 commit comments

Comments
 (0)