mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-24 13:44:06 +01:00
ie: add macro for calculating an IE's length
All over the place we do "ie[1] + 2" for getting the IE length. It is much clearer to use a macro to do this. The macro also checks for NULL, and returns zero in this case.
This commit is contained in:
parent
c18b1289a5
commit
922e10e82c
3
src/ie.h
3
src/ie.h
@ -258,6 +258,9 @@ enum ie_rsn_akm_suite {
|
|||||||
((akm == IE_RSN_AKM_SUITE_SAE_SHA256) || \
|
((akm == IE_RSN_AKM_SUITE_SAE_SHA256) || \
|
||||||
(akm == IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256))
|
(akm == IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256))
|
||||||
|
|
||||||
|
#define IE_LEN(ie) \
|
||||||
|
(ie) ? (ie)[1] + 2 : 0
|
||||||
|
|
||||||
struct ie_tlv_iter {
|
struct ie_tlv_iter {
|
||||||
unsigned int max;
|
unsigned int max;
|
||||||
unsigned int pos;
|
unsigned int pos;
|
||||||
|
Loading…
Reference in New Issue
Block a user