staging: r8188eu: calculate the addba request length
authorMartin Kaiser <martin@kaiser.cx>
Tue, 24 May 2022 09:00:29 +0000 (11:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 05:59:47 +0000 (07:59 +0200)
commit76d01595b24c53ff223f888289d362a4dd94420c
tree4f7b562ba54970874b80b42b3327d39c2b025299
parent56580e22fecb7cbe11f9debb8de07662a847d444
staging: r8188eu: calculate the addba request length

When issue_action_BA compiles an addba request, it does not add any
extensions. start_seq_num is the last field of the addba request.

The length of the request is the offset of the end of start_seq_num in the
struct ieee80211_mgmt that defines the message.

Use offsetofend to calculate this offset and drop the intermediate pktlen
increments as we add addba request components. (We have to keep the
increments for other message types until we use offsetofend for them as
well.)

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220524090029.242584-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme_ext.c