mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
MBO: Do not add reason_detail in non_pref_chan attr (STA)
The reason detail field in non_pref_chan attribute was removed from MBO draft v0.0_r25, so the STA should not include this field to be compliant with the latest draft. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
a483c6f1e2
commit
4a83d4b686
@ -68,14 +68,13 @@ static void wpas_mbo_non_pref_chan_attr_body(struct wpa_supplicant *wpa_s,
|
|||||||
|
|
||||||
wpabuf_put_u8(mbo, wpa_s->non_pref_chan[start].preference);
|
wpabuf_put_u8(mbo, wpa_s->non_pref_chan[start].preference);
|
||||||
wpabuf_put_u8(mbo, wpa_s->non_pref_chan[start].reason);
|
wpabuf_put_u8(mbo, wpa_s->non_pref_chan[start].reason);
|
||||||
wpabuf_put_u8(mbo, wpa_s->non_pref_chan[start].reason_detail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void wpas_mbo_non_pref_chan_attr(struct wpa_supplicant *wpa_s,
|
static void wpas_mbo_non_pref_chan_attr(struct wpa_supplicant *wpa_s,
|
||||||
struct wpabuf *mbo, u8 start, u8 end)
|
struct wpabuf *mbo, u8 start, u8 end)
|
||||||
{
|
{
|
||||||
size_t size = end - start + 4;
|
size_t size = end - start + 3;
|
||||||
|
|
||||||
if (size + 2 > wpabuf_tailroom(mbo))
|
if (size + 2 > wpabuf_tailroom(mbo))
|
||||||
return;
|
return;
|
||||||
@ -100,7 +99,7 @@ static void wpas_mbo_non_pref_chan_subelement(struct wpa_supplicant *wpa_s,
|
|||||||
struct wpabuf *mbo, u8 start,
|
struct wpabuf *mbo, u8 start,
|
||||||
u8 end)
|
u8 end)
|
||||||
{
|
{
|
||||||
size_t size = end - start + 8;
|
size_t size = end - start + 7;
|
||||||
|
|
||||||
if (size + 2 > wpabuf_tailroom(mbo))
|
if (size + 2 > wpabuf_tailroom(mbo))
|
||||||
return;
|
return;
|
||||||
@ -131,7 +130,6 @@ static void wpas_mbo_non_pref_chan_attrs(struct wpa_supplicant *wpa_s,
|
|||||||
if (!non_pref ||
|
if (!non_pref ||
|
||||||
non_pref->oper_class != start_pref->oper_class ||
|
non_pref->oper_class != start_pref->oper_class ||
|
||||||
non_pref->reason != start_pref->reason ||
|
non_pref->reason != start_pref->reason ||
|
||||||
non_pref->reason_detail != start_pref->reason_detail ||
|
|
||||||
non_pref->preference != start_pref->preference) {
|
non_pref->preference != start_pref->preference) {
|
||||||
if (subelement)
|
if (subelement)
|
||||||
wpas_mbo_non_pref_chan_subelement(wpa_s, mbo,
|
wpas_mbo_non_pref_chan_subelement(wpa_s, mbo,
|
||||||
@ -250,9 +248,9 @@ static int wpa_non_pref_chan_is_eq(struct wpa_mbo_non_pref_channel *a,
|
|||||||
*
|
*
|
||||||
* In MBO IE non-preferred channel subelement we can put many channels in an
|
* In MBO IE non-preferred channel subelement we can put many channels in an
|
||||||
* attribute if they are in the same operating class and have the same
|
* attribute if they are in the same operating class and have the same
|
||||||
* preference, reason, and reason detail. To make it easy for the functions that
|
* preference and reason. To make it easy for the functions that build
|
||||||
* build the IE attributes and WNM Request subelements, save the channels sorted
|
* the IE attributes and WNM Request subelements, save the channels sorted
|
||||||
* by their oper_class, reason, and reason_detail.
|
* by their oper_class and reason.
|
||||||
*/
|
*/
|
||||||
static int wpa_non_pref_chan_cmp(const void *_a, const void *_b)
|
static int wpa_non_pref_chan_cmp(const void *_a, const void *_b)
|
||||||
{
|
{
|
||||||
@ -262,8 +260,6 @@ static int wpa_non_pref_chan_cmp(const void *_a, const void *_b)
|
|||||||
return a->oper_class - b->oper_class;
|
return a->oper_class - b->oper_class;
|
||||||
if (a->reason != b->reason)
|
if (a->reason != b->reason)
|
||||||
return a->reason - b->reason;
|
return a->reason - b->reason;
|
||||||
if (a->reason_detail != b->reason_detail)
|
|
||||||
return a->reason_detail - b->reason_detail;
|
|
||||||
return a->preference - b->preference;
|
return a->preference - b->preference;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +294,6 @@ int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
|
|||||||
unsigned int _chan;
|
unsigned int _chan;
|
||||||
unsigned int _preference;
|
unsigned int _preference;
|
||||||
unsigned int _reason;
|
unsigned int _reason;
|
||||||
unsigned int _reason_detail;
|
|
||||||
|
|
||||||
if (num == size) {
|
if (num == size) {
|
||||||
size = size ? size * 2 : 1;
|
size = size ? size * 2 : 1;
|
||||||
@ -314,13 +309,11 @@ int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
|
|||||||
|
|
||||||
chan = &chans[num];
|
chan = &chans[num];
|
||||||
|
|
||||||
ret = sscanf(token, "%u:%u:%u:%u:%u", &_oper_class,
|
ret = sscanf(token, "%u:%u:%u:%u", &_oper_class,
|
||||||
&_chan, &_preference, &_reason,
|
&_chan, &_preference, &_reason);
|
||||||
&_reason_detail);
|
if (ret != 4 ||
|
||||||
if ((ret != 4 && ret != 5) ||
|
|
||||||
_oper_class > 255 || _chan > 255 ||
|
_oper_class > 255 || _chan > 255 ||
|
||||||
_preference > 255 || _reason > 65535 ||
|
_preference > 255 || _reason > 65535 ) {
|
||||||
(ret == 5 && _reason_detail > 255)) {
|
|
||||||
wpa_printf(MSG_ERROR, "Invalid non-pref chan input %s",
|
wpa_printf(MSG_ERROR, "Invalid non-pref chan input %s",
|
||||||
token);
|
token);
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -329,7 +322,6 @@ int wpas_mbo_update_non_pref_chan(struct wpa_supplicant *wpa_s,
|
|||||||
chan->chan = _chan;
|
chan->chan = _chan;
|
||||||
chan->preference = _preference;
|
chan->preference = _preference;
|
||||||
chan->reason = _reason;
|
chan->reason = _reason;
|
||||||
chan->reason_detail = ret == 4 ? 0 : _reason_detail;
|
|
||||||
|
|
||||||
if (wpas_mbo_validate_non_pref_chan(chan->oper_class,
|
if (wpas_mbo_validate_non_pref_chan(chan->oper_class,
|
||||||
chan->chan, chan->reason)) {
|
chan->chan, chan->reason)) {
|
||||||
|
@ -677,11 +677,11 @@ fast_reauth=1
|
|||||||
|
|
||||||
# Multi Band Operation (MBO) non-preferred channels
|
# Multi Band Operation (MBO) non-preferred channels
|
||||||
# A space delimited list of non-preferred channels where each channel is a colon
|
# A space delimited list of non-preferred channels where each channel is a colon
|
||||||
# delimited list of values. Reason detail is optional.
|
# delimited list of values.
|
||||||
# Format:
|
# Format:
|
||||||
# non_pref_chan=<oper_class>:<chan>:<preference>:<reason>[:reason_detail]
|
# non_pref_chan=<oper_class>:<chan>:<preference>:<reason>
|
||||||
# Example:
|
# Example:
|
||||||
# non_pref_chan="81:5:10:2:0 81:1:0:2:0 81:9:0:2"
|
# non_pref_chan="81:5:10:2 81:1:0:2 81:9:0:2"
|
||||||
|
|
||||||
# MBO Cellular Data Capabilities
|
# MBO Cellular Data Capabilities
|
||||||
# 1 = Cellular data connection available
|
# 1 = Cellular data connection available
|
||||||
|
@ -1050,7 +1050,6 @@ struct wpa_supplicant {
|
|||||||
enum mbo_non_pref_chan_reason reason;
|
enum mbo_non_pref_chan_reason reason;
|
||||||
u8 oper_class;
|
u8 oper_class;
|
||||||
u8 chan;
|
u8 chan;
|
||||||
u8 reason_detail;
|
|
||||||
u8 preference;
|
u8 preference;
|
||||||
} *non_pref_chan;
|
} *non_pref_chan;
|
||||||
size_t non_pref_chan_num;
|
size_t non_pref_chan_num;
|
||||||
|
Loading…
Reference in New Issue
Block a user