]> git.ipfire.org Git - thirdparty/hostap.git/commit
HE: Fix set_he_cap() parsing of config options for MU EDCA Params
authorJouni Malinen <jouni@codeaurora.org>
Mon, 11 Feb 2019 23:16:13 +0000 (01:16 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 11 Feb 2019 23:23:30 +0000 (01:23 +0200)
commitfe468b071434098b74baffb361bf9e9375609dd8
tree6ce5e4c3f1c04316940a54ab9dcfd3488ba10f5b
parent6c02fa214b215e45244dcd7100bba3315efe4a4d
HE: Fix set_he_cap() parsing of config options for MU EDCA Params

When I replaced the POS() function with ffs() when applying relevant
parts from the original patch, this ended up breaking the frame
construction since the POS() function was supposed to count the bit
offset for the mask with 0 being the LSB instead of 1 returned by ffs().
Furthermore, ffs() is not available in all C libraries (e.g., not
directly exposed by strings.h on Android), so better not depend on that
or compiler builtins for this since there is no need for this to be as
fast as possible in configuration parsing.

Fix this with a simple function to determine the number of bits the
value needs to be shifted left to align with the mask.

Fixes: 11ce7a1bc3e2 ("HE: Add MU EDCA Parameter Set element (AP)")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
hostapd/config_file.c